Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##
- # Backend directives
- #
- upstream erp.accomodata.be_8069 {
- server 172.19.0.19:8069;
- }
- upstream erp.accomodata.be_8072 {
- server 172.19.0.19:8072;
- }
- # port 80 server directive
- server {
- listen 80;
- server_name erp.accomodata.be;
- # letsencrypt certbot webroot
- # https://community.letsencrypt.org/t/how-to-nginx-configuration-to-enable-acme-challenge-support-on-all-http-virtual-hosts/5622
- location ^~ /.well-known {
- default_type "text/plain";
- root /srv/webroot/ ;
- }
- location = /.well-known/acme-challenge/ {
- return 404;
- }
- # Set HSTS to 365 days
- add_header Strict-Transport-Security 'max-age=31536000';
- # redirect non http requests to https
- location / { # the default location redirects to https
- return 301 https://$server_name$request_uri;
- }
- }
- server {
- listen 443 ssl http2;
- server_name erp.accomodata.be;
- gzip on;
- # ssl certificate files
- ssl_certificate /etc/letsencrypt/live/accomodata.be/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/accomodata.be/privkey.pem;
- ssl_trusted_certificate /etc/letsencrypt/live/accomodata.be/fullchain.pem;
- # Specifies the maximum accepted body size of a client request,
- # as indicated by the request header Content-Length.
- # set to 0 to disable
- client_max_body_size 0;
- # Set HSTS to 365 days
- add_header Strict-Transport-Security 'max-age=31536000';
- location / {
- proxy_pass http://erp.accomodata.be_8069;
- }
- location ~ ^/longpolling/ {
- proxy_pass http://erp.accomodata.be_8072;
- }
- # letsencrypt certbot webroot
- # https://community.letsencrypt.org/t/how-to-nginx-configuration-to-enable-acme-challenge-support-on-all-http-virtual-hosts/5622
- location ^~ /.well-known {
- default_type "text/plain";
- root /srv/webroot/ ;
- }
- location = /.well-known/acme-challenge/ {
- return 404;
- }
- # cache some static data in memory for 60mins
- location ~* ^/([0-9a-zA-Z]+)/static/ {
- proxy_cache_valid 200 60m;
- proxy_buffering on;
- # Set expires header for 12 hour
- expires 43200;
- proxy_pass http://erp.accomodata.be_8069;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement