1. server {
    2. listen 80;
    3. server_name dev.lighting.com localhost 127.0.0.1 47.102.132.18;
    4. root /usr/nginx/dist;
    5. index index.html;
    6. access_log /var/log/access.log;
    7. error_log /var/log/access.log;
    8. location / {
    9. try_files $uri $uri/ /index.html;
    10. proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    11. proxy_set_header Host $http_host;
    12. proxy_redirect off;
    13. if (!-f $request_filename) {
    14. proxy_pass http://47.102.132.18:8000;
    15. break;
    16. }
    17. }
    18. location @router{
    19. rewrite ^.*$ /index.html last;
    20. }
    21. location ~ \.php$ {
    22. # fastcgi_split_path_info ^(.+\.php)(/.+)$;
    23. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
    24. # With php5-cgi alone:
    25. # fastcgi_pass 127.0.0.1:9000;
    26. # With php5-fpm:
    27. fastcgi_pass unix:/var/run/php5-fpm.sock;
    28. fastcgi_index index.php;
    29. include fastcgi_params;
    30. }
    31. # deny access to .htaccess files, if Apache's document root
    32. # concurs with nginx's one
    33. #
    34. location ~ /\.ht {
    35. deny all;
    36. }
    37. }