[ADD] script template_nginx
This commit is contained in:
parent
8ddcec3f21
commit
e80aa593f8
1 changed files with 71 additions and 0 deletions
71
script/nginx/template_nginx
Normal file
71
script/nginx/template_nginx
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# TODO replace test1 by your hostname and fix server_name and run certbot
|
||||
upstream erplibretest1 {
|
||||
server 127.0.0.1:10000;
|
||||
}
|
||||
upstream erplibretest1chat {
|
||||
server 127.0.0.1:10002;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
server_name test1.ca;
|
||||
|
||||
# Add Headers for erplibre proxy mode
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
add_header X-Frame-Options "SAMEORIGIN";
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
||||
# erplibre request log files
|
||||
access_log /var/log/nginx/test1-access.log;
|
||||
error_log /var/log/nginx/test1-error.log;
|
||||
|
||||
# Increase proxy buffer size
|
||||
proxy_buffers 16 64k;
|
||||
proxy_buffer_size 128k;
|
||||
|
||||
proxy_read_timeout 720s;
|
||||
proxy_connect_timeout 720s;
|
||||
proxy_send_timeout 720s;
|
||||
|
||||
# Force timeouts if the backend dies
|
||||
proxy_next_upstream error timeout invalid_header http_500 http_502
|
||||
http_503;
|
||||
|
||||
types {
|
||||
text/less less;
|
||||
text/scss scss;
|
||||
}
|
||||
|
||||
# Enable data compression
|
||||
gzip on;
|
||||
gzip_min_length 1100;
|
||||
gzip_buffers 4 32k;
|
||||
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript application/pdf image/jpeg image/png;
|
||||
gzip_vary on;
|
||||
client_header_buffer_size 4k;
|
||||
large_client_header_buffers 4 64k;
|
||||
client_max_body_size 1024M;
|
||||
|
||||
location / {
|
||||
proxy_pass http://erplibretest1;
|
||||
# by default, do not forward anything
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
location /longpolling {
|
||||
proxy_pass http://erplibretest1chat;
|
||||
}
|
||||
|
||||
# cache some static data in memory for 60mins.
|
||||
location ~ /[a-zA-Z0-9_-]*/static/ {
|
||||
proxy_cache_valid 200 302 60m;
|
||||
proxy_cache_valid 404 1m;
|
||||
proxy_buffering on;
|
||||
expires 864000;
|
||||
proxy_pass http://erplibretest1;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue