nginx configs

This commit is contained in:
Masroor Ehsan 2025-01-27 11:17:15 +06:00
parent c81f42d915
commit 045df2ea34
2 changed files with 30 additions and 9 deletions

View File

@ -1,5 +1,17 @@
server {
listen [::]:80 default_server;
listen 80;
include /etc/nginx/enabled-sites/*.conf;
proxy_intercept_errors off;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
gzip_comp_level 9;
etag on;
charset utf-8;
# max upload size
client_max_body_size 250M;
include /etc/nginx/enabled-sites/*.conf;
}

View File

@ -3,13 +3,15 @@ location / {
index index.html index.htm;
try_files $uri $uri/ /index.html;
add_header Cross-Origin-Opener-Policy same-origin;
add_header Cross-Origin-Embedder-Policy require-corp;
add_header Cross-Origin-Resource-Policy same-origin;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
add_header Cross-Origin-Opener-Policy same-origin;
add_header Cross-Origin-Embedder-Policy require-corp;
add_header Cross-Origin-Resource-Policy same-origin;
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
error_page 500 502 503 504 /50x.html;
@ -20,9 +22,16 @@ location = /50x.html {
# https://book.orthanc-server.com/faq/nginx.html#nginx
location /orthanc/ {
proxy_pass http://orthanc:8042;
proxy_set_header HOST $host;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
expires 0;
add_header Cache-Control private;
proxy_pass http://orthanc:8042/;
rewrite /orthanc(.*) $1 break;
add_header 'Access-Control-Allow-Credentials' 'true';