forked from kung-foo/alpine-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy-site.conf
34 lines (25 loc) · 1.05 KB
/
my-site.conf
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
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
upstream backend {
server ${PROXY_TARGET};
}
server {
listen 8080 default_server;
listen [::]:8080 default_server ipv6only=on;
server_name ${SITE_HOST_NAME} www.${SITE_HOST_NAME};
return 301 https://${SITE_HOST_NAME}$request_uri;
access_log /var/log/nginx/access.log main;
}
server {
listen 8443 default_server ssl;
listen [::]:8443 default_server ipv6only=on ssl;
ssl_certificate /etc/nginx/ssl/${SITE_HOST_NAME}.crt;
ssl_certificate_key /etc/nginx/ssl/${SITE_HOST_NAME}.key;
server_name ${SITE_HOST_NAME} www.${SITE_HOST_NAME};
access_log /var/log/nginx/access.log main;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
location / {
proxy_pass http://backend;
}
}