forked from codesquad-members-2023/second-hand-max
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf
58 lines (46 loc) · 1.38 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
user nginx;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
keepalive_timeout 65;
include /etc/nginx/mime.types;
default_type application/octet-stream;
upstream my-api {
server app:8080;
}
server {
listen 80;
listen [::]:80;
server_name fishprince.site;
location /.well-known/acme-challenge {
allow all;
root /usr/share/nginx/html;
try_files $uri = 404;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl ipv6only=on;
server_name fishprince.site;
ssl_certificate /etc/letsencrypt/live/fishprince.site/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/fishprince.site/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://my-api;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
}
}