final/deployment/nginx/nginx.conf

60 lines
1.4 KiB
Nginx Configuration File
Raw Normal View History

2016-01-14 21:54:25 +08:00
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
gzip_types application/json;
upstream blog {
server unix:/home/root/e2s/tmp/sockets/e2s.socket;
}
server {
listen 80;
#server_name blog.com;
root /home/root/e2s/public;
try_files $uri/index.html $uri.html $uri @user1;
location @user1 {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-Ip $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering on;
proxy_pass http://blog;
}
location ~ ^(/assets) {
access_log off;
expires max;
}
}
}