diff --git a/templates/egg.conf.epp b/templates/egg.conf.epp index 8e48727c817d48a9e3e304142c698cdbd3e4bb1c..7d15519c02176f1a2547d744287e0ebdffd71f97 100644 --- a/templates/egg.conf.epp +++ b/templates/egg.conf.epp @@ -1,71 +1,64 @@ <%- | String[1] $cert_name, | -%> server { - server_name teman.it.liu.se; - root /var/www/teman; + listen 80 ; + listen [::]:443 ssl ; + listen 443 ssl ; + + ssl_certificate /etc/pki/tls/certs/letsencrypt-cert_chain-egg.it.liu.se.pem ; + ssl_certificate_key /etc/pki/tls/private/letsencrypt-egg.it.liu.se.key ; - # Load configuration files for the default server block. - #include /etc/nginx/default.d/*.conf; + server_name teman.it.liu.se ; + root /var/www/teman ; location / { - #expires -1; + #expires -1 ; } - error_page 404 /404.html; + error_page 404 /404.html ; location = /40x.html { } - error_page 500 502 503 504 /50x.html; + error_page 500 502 503 504 /50x.html ; location = /50x.html { } } server { - listen [::]:80 ipv6only=on ; - listen 80; - - server_name ntadigital.it.liu.se egg.it.liu.se; - - location / { - return 301 https://ntadigital.it.liu.se; - } -} - -server { + listen 80 ; listen [::]:443 ssl ipv6only=on ; listen 443 ssl ; - server_name ntadigital.it.liu.se; + + ssl_certificate /etc/pki/tls/certs/letsencrypt-cert_chain-egg.it.liu.se.pem ; + ssl_certificate_key /etc/pki/tls/private/letsencrypt-egg.it.liu.se.key ; - ssl_certificate /etc/pki/tls/certs/letsencrypt-cert_chain-<%= $cert_name %>.pem ; - ssl_certificate_key /etc/pki/tls/private/letsencrypt-<%= $cert_name %>.key ; + server_name ntadigital.it.liu.se ; - client_max_body_size 0; + client_max_body_size 0 ; location = /favicon.ico { - log_not_found off; - access_log off; + log_not_found off ; + access_log off ; } location /system/ { + auth_request /auth-verify ; - auth_request /auth-verify; - - root /var/www/nta-digital-portal/private/uploads; - #root /var/www/ntadigital_temp/public; + root /var/www/nta-digital-portal/private/uploads ; } location /auth-verify { - internal; - proxy_pass http://localhost:3000/api/auth/verify; - proxy_pass_request_body off; - proxy_set_header Content-Length ""; - proxy_set_header X-Original-URI $request_uri; + internal ; + proxy_pass http://localhost:3000/api/auth/verify ; + proxy_pass_request_body off ; + proxy_set_header Content-Length "" ; + proxy_set_header X-Original-URI $request_uri ; } location / { - proxy_pass http://localhost:3000; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; + proxy_pass http://localhost:3000 ; + proxy_http_version 1.1 ; + proxy_set_header Upgrade $http_upgrade ; + proxy_set_header Connection 'upgrade' ; + proxy_set_header Host $host ; + proxy_cache_bypass $http_upgrade ; } }