timemanager/frontend/nginx.conf.template
Nils Beyer 7f6b4c2e08
All checks were successful
Java CI with Maven / build (push) Successful in 48s
Implement redirect for /api in docker deployment
2023-11-13 10:46:45 +01:00

50 lines
1.2 KiB
Plaintext

user nginx;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_types text/css application/javascript;
server {
listen 80 default_server;
listen [::]:80 default_server;
root /usr/share/nginx/html;
index index.html index.htm index.nginx-debian.html;
add_header "Access-Control-Allow-Origin" "*";
add_header "Access-Control-Allow-Methods" 'GET, POST, OPTIONS, PUT, DELETE';
add_header "Access-Control-Allow-Headers" 'X-Requested-With,Accept,Content-Type, Origin';
location /api {
proxy_pass ${BACKEND_URL};
add_header "Access-Control-Allow-Origin" "*";
add_header "Access-Control-Allow-Methods" 'GET, POST, OPTIONS, PUT, DELETE';
add_header "Access-Control-Allow-Headers" 'X-Requested-With,Accept,Content-Type, Origin';
}
location / {
try_files $uri $uri/ /index.html =404;
}
}
}