| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- # Cache zone
- proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=7d use_temp_path=off;
- upstream nextjs {
- server 127.0.0.1:3000;
- }
- server {
- listen 80 default_server;
- server_name _;
- server_tokens off;
- gzip on;
- gzip_proxied any;
- gzip_comp_level 4;
- gzip_types text/css application/javascript image/svg+xml;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection 'upgrade';
- proxy_set_header Host $host;
- proxy_cache_bypass $http_upgrade;
- location /ping {
- return 200 'ssl-nginx-PONG!: $http_upgrade';
- add_header Content-Type text/plain;
- }
- # # BUILT ASSETS (E.G. JS BUNDLES)
- # # Browser cache - max cache headers from Next.js as build id in url
- # # Server cache - valid forever (cleared after cache "inactive" period)
- # location /_next/static {
- # proxy_cache STATIC;
- # proxy_pass http://nextjs;
- # }
- #
- # # STATIC ASSETS (E.G. IMAGES)
- # # Browser cache - "no-cache" headers from Next.js as no build id in url
- # # Server cache - refresh regularly in case of changes
- # location /static {
- # proxy_cache STATIC;
- # proxy_ignore_headers Cache-Control;
- # proxy_cache_valid 60m;
- # proxy_pass http://nextjs;
- # }
- # DYNAMIC ASSETS - NO CACHE
- location / {
- proxy_pass http://nextjs;
- }
- location ~ ^/alaa/api/v2/(.*)$ {
- proxy_redirect off;
- proxy_pass_request_headers on;
- proxy_pass http://192.168.8.12:700/api/v2/$1?$query_string;
- }
- location ~ ^/alaa/api/v1/(.*)$ {
- proxy_redirect off;
- proxy_pass_request_headers on;
- proxy_pass http://192.168.8.12:700/api/v1/$1?$query_string;
- }
- #
- # location /socket.io {
- # proxy_redirect off;
- # proxy_pass_request_headers on;
- # proxy_set_header Upgrade $http_upgrade;
- # proxy_set_header Connection "upgrade";
- # proxy_pass https://80.210.26.206:501;
- # }
- #
- # location /register-service-worker.js {
- # etag on;
- # expires 600s;
- # add_header Cache-Control "public, no-transform";
- # try_files $uri $uri/ /register-service-worker.js;
- # }
- #
- # location /firebase-messaging-sw.js {
- # etag on;
- # expires 600s;
- # add_header Cache-Control "public, no-transform";
- # try_files $uri $uri/ /firebase-messaging-sw.js;
- # }
- #
- # location ~* \.(js|css)$ {
- # etag on;
- # expires 600s;
- # add_header Cache-Control "public, no-transform";
- # try_files $uri $uri/ /index.html?$query_string;
- # }
- #
- # location ~* \.(ico|woff|woff2|ttf|svg|png|map|eot)$ {
- # etag on;
- # expires 10h;
- # add_header Cache-Control "public, no-transform";
- # try_files $uri $uri/ /index.html?$query_string;
- # }
- }
|