-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ara_frontend_nginx: add support for https/ssl
- Loading branch information
Showing
7 changed files
with
160 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# {{ ansible_managed }} | ||
|
||
upstream ara_api { | ||
# fail_timeout=0 means we always retry an upstream even if it failed | ||
# to return a good HTTP response | ||
server {{ ara_api_wsgi_bind }} fail_timeout=0; | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name {{ ara_api_fqdn }}; | ||
return 301 https://{{ ara_api_fqdn }}$request_uri; | ||
} | ||
|
||
server { | ||
listen 443; | ||
server_name {{ ara_api_fqdn }}; | ||
{% if ara_api_external_auth -%} | ||
auth_basic "Privileged access"; | ||
# A .htpasswd file | ||
auth_basic_user_file {{ ara_api_external_auth_file }}; | ||
{% endif %} | ||
|
||
client_max_body_size {{ ara_nginx_client_max_body_size }}; | ||
access_log /var/log/nginx/{{ ara_api_fqdn }}_access.log; | ||
error_log /var/log/nginx/{{ ara_api_fqdn }}_error.log; | ||
|
||
ssl on; | ||
ssl_certificate {{ ara_api_frontend_ssl_cert }}; | ||
ssl_certificate_key {{ ara_api_frontend_ssl_key }}; | ||
ssl_session_cache shared:SSL:10m; | ||
ssl_session_timeout 10m; | ||
ssl_protocols TLSv1.2 TLSv1.3; | ||
ssl_ciphers EECDH+AESGCM:EDH+AESGCM; | ||
|
||
location /static { | ||
expires 7d; | ||
add_header Cache-Control "public"; | ||
} | ||
|
||
# Everything, including static files, is served by the backend | ||
location ~ { | ||
# checks if the file exists, if not found proxy to app | ||
try_files $uri @proxy_to_app; | ||
} | ||
|
||
location @proxy_to_app { | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Host $http_host; | ||
|
||
proxy_redirect off; | ||
proxy_pass http://ara_api; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters