diff --git a/src/deb/for-download/tools/nodejs-nginx-templates/node-app-nextjs-3000.tpl b/src/deb/for-download/tools/nodejs-nginx-templates/node-app-nextjs-3000.tpl deleted file mode 100644 index 851ac0dc..00000000 --- a/src/deb/for-download/tools/nodejs-nginx-templates/node-app-nextjs-3000.tpl +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen %ip%:%proxy_port%; - server_name %domain_idn% %alias_idn%; - location / { - rewrite ^(.*) https://%domain_idn%$1 permanent; - } -include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt; -} diff --git a/src/deb/for-download/tools/nodejs-nginx-templates/node-app-that-also-handle-static files-3000tpl b/src/deb/for-download/tools/nodejs-nginx-templates/node-app-that-also-handle-static files-3000tpl new file mode 100644 index 00000000..93267737 --- /dev/null +++ b/src/deb/for-download/tools/nodejs-nginx-templates/node-app-that-also-handle-static files-3000tpl @@ -0,0 +1,29 @@ +server { + listen %ip%:%proxy_port%; + server_name %domain_idn% %alias_idn%; + error_log /var/log/%web_system%/domains/%domain%.error.log error; + + location / { + # reverse proxy for next server + proxy_pass http://localhost:3000; + 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; + + # we need to remove this 404 handling + # because next's _next folder and own handling + # try_files $uri $uri/ =404; + } + + location ~ /\.ht {return 404;} + location ~ /\.svn/ {return 404;} + location ~ /\.git/ {return 404;} + location ~ /\.hg/ {return 404;} + location ~ /\.bzr/ {return 404;} + + disable_symlinks if_not_owner from=%docroot%; + + include %home%/%user%/conf/web/nginx.%domain%.conf*; +}