altool/airflow
0
1worker_processes 1;2error_log /var/log/nginx/error.log warn;3pid /run/nginx/nginx.pid;4 5events {6 worker_connections 1024;7}8 9http {10 include /etc/nginx/mime.types;11 default_type application/octet-stream;12 13 log_format main '$remote_addr - $remote_user [$time_local] "$request" '14 '$status $body_bytes_sent "$http_referer" "$http_user_agent"';15 16 access_log /var/log/nginx/access.log main;17 sendfile on;18 keepalive_timeout 65;19 20 # Temp paths (writable by non-root)21 client_body_temp_path /run/nginx/client_temp;22 proxy_temp_path /run/nginx/proxy_temp;23 fastcgi_temp_path /run/nginx/fastcgi_temp;24 uwsgi_temp_path /run/nginx/uwsgi_temp;25 scgi_temp_path /run/nginx/scgi_temp;26 27 # Gzip compression28 gzip on;29 gzip_types text/plain text/css application/json application/javascript text/xml;30 gzip_min_length 256;31 gzip_vary on;32 33 # WebSocket upgrade map (must be before server block)34 map $http_upgrade $connection_upgrade {35 default upgrade;36 '' '';37 }38 39 # Upstreams40 upstream airflow {41 server 127.0.0.1:8080;42 keepalive 4;43 }44 45 upstream refresh {46 server 127.0.0.1:5000;47 keepalive 2;48 }49 50 server {51 listen 7860;52 server_name _;53 client_max_body_size 100M;54 55 # Security headers56 add_header X-Frame-Options SAMEORIGIN always;57 add_header X-Content-Type-Options nosniff always;58 add_header X-XSS-Protection "1; mode=block" always;59 add_header Referrer-Policy strict-origin-when-cross-origin always;60 61 # ---- Refresh service ----62 location /refresh {63 proxy_pass http://refresh;64 proxy_set_header Host $host;65 proxy_set_header Connection "";66 proxy_http_version 1.1;67 proxy_read_timeout 120s;68 }69 70 location /config {71 proxy_pass http://refresh;72 proxy_set_header Host $host;73 proxy_set_header Connection "";74 proxy_http_version 1.1;75 }76 77 location /health {78 proxy_pass http://refresh;79 proxy_set_header Host $host;80 proxy_set_header Connection "";81 proxy_http_version 1.1;82 }83 84 location /status {85 proxy_pass http://refresh;86 proxy_set_header Host $host;87 proxy_set_header Connection "";88 proxy_http_version 1.1;89 }90 91 # ---- Airflow webserver ----92 location / {93 proxy_pass http://airflow;94 proxy_set_header Host $host;95 proxy_set_header X-Real-IP $remote_addr;96 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;97 proxy_set_header X-Forwarded-Proto $scheme;98 proxy_http_version 1.1;99 proxy_set_header Connection "";100 proxy_read_timeout 300s;101 proxy_connect_timeout 75s;102 103 # WebSocket support (for live log tailing)104 proxy_set_header Upgrade $http_upgrade;105 proxy_set_header Connection $connection_upgrade;106 }107 }108}