forked from KyleAMathews/docker-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default-ssl
38 lines (28 loc) · 833 Bytes
/
default-ssl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
server {
# Make site accessible from http://localhost/
server_name localhost;
return 301 https://$host$request_uri;
include /etc/nginx/basic.conf;
}
server {
listen 443;
root /var/www;
index index.html index.htm;
# Add 1 day expires header for static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 1d;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to redirecting to index.html
try_files $uri $uri/ @root;
}
# If nginx can't find a file, fallback to the homepage.
location @root {
rewrite .* / redirect;
}
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
}