Files
appServerPortalUI/nginx.conf
2026-02-02 20:49:03 +01:00

92 lines
2.7 KiB
Nginx Configuration File
Executable File

error_log /var/log/nginx/error.log info;
server {
listen 80 default_server;
server_name _;
root /usr/share/nginx/html;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
# API calls to Auth service inside Docker network
location /api/ {
proxy_pass http://appserverauth:3000/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 80;
server_name abc.server.schooltech.ch;
auth_request /nginxauth;
location / {
proxy_pass https://thinkcentre.local:10010/;
# WebSocket and HTTPS upstream settings
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_ssl_server_name on;
proxy_ssl_name abc.server.schooltech.ch;
proxy_ssl_verify off;
proxy_set_header Host abc.server.schooltech.ch;
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;
proxy_set_header Origin $http_origin;
# iFrame erlauben
proxy_hide_header X-Frame-Options;
add_header X-Frame-Options "ALLOWALL";
proxy_hide_header Content-Security-Policy;
add_header Content-Security-Policy "frame-ancestors *";
}
location = /nginxauth {
internal;
proxy_pass http://appserverauth:3000/internal/auth;
proxy_set_header Cookie $http_cookie;
}
}
server {
listen 80;
server_name xyz.server.schooltech.ch;
auth_request /nginxauth;
location / {
proxy_pass http://thinkcentre.local:8080/;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host xyz.server.schooltech.ch;
proxy_set_header Origin $http_origin;
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;
# iFrame erlauben
proxy_hide_header X-Frame-Options;
add_header X-Frame-Options "ALLOWALL";
proxy_hide_header Content-Security-Policy;
add_header Content-Security-Policy "frame-ancestors *";
}
location = /nginxauth {
internal;
proxy_pass http://appserverauth:3000/internal/auth;
proxy_set_header Cookie $http_cookie;
}
}