Initial commit
This commit is contained in:
127
conf/nginx/site-enabled_aether_flask_gunicorn.conf
Normal file
127
conf/nginx/site-enabled_aether_flask_gunicorn.conf
Normal file
@@ -0,0 +1,127 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name
|
||||
flask_gunicorn.localhost demo.localhost dev.localhost
|
||||
|
||||
dev.oneskyit.com
|
||||
dev-app.oneskyit.com
|
||||
dev-connect.oneskyit.com *.dev-connect.oneskyit.com
|
||||
dev-demo.oneskyit.com *.dev-demo.oneskyit.com
|
||||
|
||||
dev-aapor.oneskyit.com *.dev-aapor.oneskyit.com
|
||||
dev-businessgroup.oneskyt.com *.dev-businessgroup.oneskyt.com
|
||||
|
||||
dev-cmsc.oneskyit.com *.dev-cmsc.oneskyit.com
|
||||
dev-idaa.oneskyit.com *.dev-idaa.oneskyit.com
|
||||
dev-ishlt.oneskyit.com *.dev-ishlt.oneskyit.com
|
||||
dev-ncsd.oneskyit.com *.dev-ncsd.oneskyit.com
|
||||
dev-npa.oneskyit.com *.dev-npa.oneskyit.com
|
||||
dev-rli.oneskyit.com *.dev-rli.oneskyit.com
|
||||
;
|
||||
|
||||
access_log /logs/nginx/access_flask_gunicorn.log;
|
||||
error_log /logs/nginx/error_flask_gunicorn.log;
|
||||
|
||||
client_max_body_size 5120M; #4096M or 4G; 5120M or 5G;
|
||||
|
||||
location / {
|
||||
proxy_set_header Host $http_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;
|
||||
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
|
||||
# This is needed for long running Python code. Default is 60 seconds
|
||||
# Increased from 1200 to 1500 on 2022-04-17
|
||||
fastcgi_connect_timeout 1500s;
|
||||
fastcgi_send_timeout 1500s;
|
||||
fastcgi_read_timeout 1500s;
|
||||
proxy_read_timeout 1500s;
|
||||
|
||||
proxy_pass http://flask_backend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl http2;
|
||||
|
||||
server_name
|
||||
flask_gunicorn.localhost demo.localhost dev.localhost
|
||||
|
||||
dev.oneskyit.com
|
||||
dev-app.oneskyit.com
|
||||
dev-connect.oneskyit.com *.dev-connect.oneskyit.com
|
||||
dev-demo.oneskyit.com *.dev-demo.oneskyit.com
|
||||
|
||||
dev-aapor.oneskyit.com *.dev-aapor.oneskyit.com
|
||||
dev-businessgroup.oneskyt.com *.dev-businessgroup.oneskyt.com
|
||||
|
||||
dev-cmsc.oneskyit.com *.dev-cmsc.oneskyit.com
|
||||
dev-idaa.oneskyit.com *.dev-idaa.oneskyit.com
|
||||
dev-ishlt.oneskyit.com *.dev-ishlt.oneskyit.com
|
||||
dev-ncsd.oneskyit.com *.dev-ncsd.oneskyit.com
|
||||
dev-npa.oneskyit.com *.dev-npa.oneskyit.com
|
||||
dev-rli.oneskyit.com *.dev-rli.oneskyit.com
|
||||
;
|
||||
|
||||
access_log /logs/nginx/access_flask_gunicorn.log;
|
||||
error_log /logs/nginx/error_flask_gunicorn.log;
|
||||
|
||||
include /etc/nginx/options-ssl-nginx.conf;
|
||||
|
||||
ssl_certificate /etc/certs/fullchain.pem;
|
||||
ssl_certificate_key /etc/certs/privkey.pem;
|
||||
ssl_dhparam /etc/certs/ssl-dhparams.pem;
|
||||
|
||||
# include brotli.conf;
|
||||
# include gzip.conf;
|
||||
|
||||
client_max_body_size 5120M; #4096M or 4G; 5120M or 5G;
|
||||
|
||||
location / {
|
||||
proxy_set_header Host $http_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;
|
||||
|
||||
proxy_redirect off;
|
||||
proxy_buffering off;
|
||||
|
||||
# This is needed for long running Python code. Default is 60 seconds
|
||||
# Increased from 1200 to 1500 on 2022-04-17
|
||||
fastcgi_connect_timeout 1500s;
|
||||
fastcgi_send_timeout 1500s;
|
||||
fastcgi_read_timeout 1500s;
|
||||
proxy_read_timeout 1500s;
|
||||
|
||||
proxy_pass http://flask_backend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
upstream flask_backend {
|
||||
# sticky sessions
|
||||
ip_hash;
|
||||
|
||||
# enable least connections balancing method
|
||||
# least_conn;
|
||||
|
||||
# zone backend 64k; # Use NGINX Plus' shared memory
|
||||
|
||||
# server webserver1 weight=1;
|
||||
# server webserver2 weight=4;
|
||||
|
||||
# larger number will recieve more requests
|
||||
# Example of 20 vs 10: 20 will recieve twice as many requests as 10
|
||||
server aether_app_gunicorn:5005 weight=20 max_fails=3 fail_timeout=30s;
|
||||
# server aether_app_gunicorn_bak:5005 weight=10 max_fails=1 fail_timeout=30s;
|
||||
|
||||
# maintain up to 20 idle connections to the group of upstream servers
|
||||
# keepalive 20;
|
||||
}
|
||||
Reference in New Issue
Block a user