server {
listen 80;
server_name dev.lighting.com localhost 127.0.0.1 47.102.132.18;
root /usr/nginx/dist;
index index.html;
access_log /var/log/access.log;
error_log /var/log/access.log;
location / {
try_files $uri $uri/ /index.html;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://47.102.132.18:8000;
break;
}
}
location @router{
rewrite ^.*$ /index.html last;
}
location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}