Skip to content

Commit b6d8c47

Browse files
committed
fix: improve nginx.conf, change compose port
1 parent 3b9f92e commit b6d8c47

File tree

2 files changed

+36
-23
lines changed

2 files changed

+36
-23
lines changed

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
nginx:
2020
image: nginx:1.25.4-alpine
2121
ports:
22-
- "8083:80"
22+
- "8083:443"
2323
volumes:
2424
- ./nginx.conf:/etc/nginx/nginx.conf
2525
#

nginx.conf

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
1-
include /etc/nginx/mime.types;
1+
worker_processes 1;
22

3-
server {
4-
# ipv4
5-
listen 443 ssl;
6-
# ipv6
7-
listen [::]:443 ssl;
8-
server_name ${gh_user}.github.io/${repo_subdir};
3+
events {
4+
worker_events 1024;
5+
}
96

10-
types {
11-
application/wasm wasm;
12-
}
7+
http {
8+
include /etc/nginx/mime.types;
9+
default_type application/octet-stream;
10+
sendfile on;
11+
keepalive_timeout 65;
12+
gzip on;
1313

14-
# yew-rs frontend
15-
location / {
14+
server {
15+
#
16+
listen 443 ssl; # ipv4
17+
listen [::]:443 ssl; # ipv6
18+
server_name ${gh_user}.github.io/${repo_name};
19+
#
20+
# yew-rs frontend
1621
root ./client/dist/index.html;
17-
try_files $uri $uri/ ./client/index.html;
18-
include /etc/nginx/mime.types;
19-
default_type application/octet-stream;
20-
}
21-
# SpringBoot backend
22-
location /api {
23-
proxy_pass http://localhost:8080;
24-
proxy_set_header X-Real-IP $remote_addr;
25-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26-
proxy_set_header Host $http_host;
22+
location / {
23+
proxy_pass http://
24+
try_files $uri $uri/ ./client/index.html;
25+
include /etc/nginx/mime.types;
26+
types {
27+
application/wasm wasm;
28+
}
29+
30+
default_type application/octet-stream;
31+
}
32+
#
33+
# SpringBoot backend
34+
location /api {
35+
proxy_pass http://localhost:8080;
36+
proxy_set_header X-Real-IP $remote_addr;
37+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
38+
proxy_set_header Host $http_host;
2739

40+
}
2841
}
2942
}

0 commit comments

Comments
 (0)