dev.node.com.conf 968 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. upstream dev.node.com_pool {
  2. server 127.0.0.1:3000 max_fails=3 fail_timeout=30s;
  3. }
  4. server {
  5. listen 80;
  6. server_name dev.node.com;
  7. autoindex on;
  8. error_log /data/weblog/nginx/dev.node.com.error.log;
  9. # access_log /data/weblog/nginx/dev.node.com.access.log;
  10. root /Users/benzhan/Desktop/nodejs/nodebase/;
  11. location / {
  12. proxy_set_header X-Real-IP $remote_addr;
  13. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  14. proxy_set_header Host $http_host;
  15. if (!-f $request_filename) {
  16. proxy_pass http://dev.node.com_pool;
  17. }
  18. if (-f $request_filename) {
  19. rewrite .* /403.html;
  20. }
  21. }
  22. location /public {
  23. allow all;
  24. }
  25. # 开发环境不缓存静态文件
  26. location ~/public/.*\.(html|css|js|eot|svg|ttf|woff|woff2|map|cur)$ {
  27. expires off;
  28. add_header Cache-Control no-cache;
  29. }
  30. }