Skip to content

Commit 6633d65

Browse files
committed
add nginx default.conf demo
1 parent 4aaf2c4 commit 6633d65

2 files changed

Lines changed: 56 additions & 1 deletion

File tree

deployment/common/docker-compose-common.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ services:
2222
environment:
2323
- TZ=Asia/Shanghai
2424
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
25+
networks:
26+
- backend
27+
2528

2629

2730
redis:
@@ -35,6 +38,8 @@ services:
3538
- ./redis/conf/redis.conf:/usr/local/etc/redis/redis.conf
3639
environment:
3740
- TZ=Asia/Shanghai
41+
networks:
42+
- backend
3843

3944
nginx:
4045
image: nginx:1.27
@@ -48,4 +53,10 @@ services:
4853
- ./nginx/logs:/var/log/nginx
4954
- ../frontend/:/frontend
5055
environment:
51-
- TZ=Asia/Shanghai
56+
- TZ=Asia/Shanghai
57+
networks:
58+
- backend
59+
60+
networks:
61+
backend:
62+
driver: bridge
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
5+
#access_log /var/log/nginx/host.access.log main;
6+
7+
location / {
8+
root /usr/share/nginx/html;
9+
index index.html index.htm;
10+
}
11+
12+
#error_page 404 /404.html;
13+
14+
# redirect server error pages to the static page /50x.html
15+
#
16+
error_page 500 502 503 504 /50x.html;
17+
location = /50x.html {
18+
root /usr/share/nginx/html;
19+
}
20+
21+
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
22+
#
23+
#location ~ \.php$ {
24+
# proxy_pass http://127.0.0.1;
25+
#}
26+
27+
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
28+
#
29+
#location ~ \.php$ {
30+
# root html;
31+
# fastcgi_pass 127.0.0.1:9000;
32+
# fastcgi_index index.php;
33+
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
34+
# include fastcgi_params;
35+
#}
36+
37+
# deny access to .htaccess files, if Apache's document root
38+
# concurs with nginx's one
39+
#
40+
#location ~ /\.ht {
41+
# deny all;
42+
#}
43+
}
44+

0 commit comments

Comments
 (0)