-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
60 lines (47 loc) · 1.51 KB
/
nginx.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Disable emitting nginx version in the "Server" response header field
server_tokens off;
# # Use site-specific access and error logs
# access_log /var/log/nginx/sudan_art.access.log;
# error_log /var/log/nginx/sudan_art.error.log;
server {
listen 80;
listen [::]:80;
server_name glowingintech.com www.glowingintech.com;
client_max_body_size 15M;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 default_server ssl http2;
listen [::]:443 ssl http2;
client_max_body_size 15M;
server_name sudan-art.com www.sudan-art.com;
ssl_certificate /etc/nginx/ssl/live/sudan-art.com/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/live/sudan-art.com/privkey.pem;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;
}
location /api/artwork {
try_files $uri$is_args$query_string @proxy_api;
}
location /recent {
try_files $uri @proxy_api;
}
location /upload {
try_files $uri @proxy_api;
}
location @proxy_api {
# Django refers to docker service name
proxy_pass http://django:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
}
}