default.conf 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Cache zone
  2. proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off;
  3. upstream nextjs {
  4. server 127.0.0.1:3000;
  5. }
  6. upstream palizvaniback {
  7. server shahidpalizvani.ir;
  8. }
  9. server {
  10. listen 80 default_server;
  11. server_name palizvani.ir www.palizvani.ir ;
  12. server_tokens off;
  13. gzip on;
  14. gzip_proxied any;
  15. gzip_comp_level 4;
  16. gzip_types text/css application/javascript image/svg+xml;
  17. proxy_http_version 1.1;
  18. proxy_set_header Upgrade $http_upgrade;
  19. proxy_set_header Connection 'upgrade';
  20. proxy_set_header Host $host;
  21. proxy_cache_bypass $http_upgrade;
  22. #
  23. # location /ping {
  24. # return 200 'ssl-nginx-PONG!: $http_upgrade';
  25. # add_header Content-Type text/plain;
  26. # }
  27. location / {
  28. proxy_pass http://nextjs;
  29. }
  30. location /api {
  31. proxy_pass http://palizvaniback/api;
  32. proxy_set_header Host $host;
  33. }
  34. # location ~ ^/api/(.*)$ {
  35. # proxy_redirect off;
  36. # proxy_pass_request_headers on;
  37. # proxy_pass http://palizvani.hghweb.ir/api/$1?$query_string;
  38. # }
  39. # location /socket.io {
  40. # proxy_redirect off;
  41. # proxy_pass_request_headers on;
  42. # proxy_set_header Upgrade $http_upgrade;
  43. # proxy_set_header Connection "upgrade";
  44. # proxy_pass https://80.210.26.206:501;
  45. # }
  46. #
  47. # location /register-service-worker.js {
  48. # etag on;
  49. # expires 600s;
  50. # add_header Cache-Control "public, no-transform";
  51. # try_files $uri $uri/ /register-service-worker.js;
  52. # }
  53. #
  54. # location /firebase-messaging-sw.js {
  55. # etag on;
  56. # expires 600s;
  57. # add_header Cache-Control "public, no-transform";
  58. # try_files $uri $uri/ /firebase-messaging-sw.js;
  59. # }
  60. # location ~* \.(js|css)$ {
  61. # etag on;
  62. # expires 600s;
  63. # add_header Cache-Control "public, no-transform";
  64. # try_files $uri $uri/ /?$query_string;
  65. # }
  66. #
  67. # location ~* \.(ico|woff|woff2|ttf|svg|png|map|eot)$ {
  68. # etag on;
  69. # expires 10h;
  70. # add_header Cache-Control "public, no-transform";
  71. # try_files $uri $uri/ /?$query_string;
  72. # }
  73. }