Skip to content

Commit

Permalink
ci(docker): nginx docker modify
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang Li committed Jul 23, 2024
1 parent 143e5c8 commit d11306e
Showing 1 changed file with 36 additions and 34 deletions.
70 changes: 36 additions & 34 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,51 @@ http {
#域名可以有多个,用空格隔开
server_name promonkeyli.top;
# http => https
return 301 https://$host$request_uri;
# return 301 https://$host$request_uri;

#定义本虚拟主机的访问日志
#access_log /admin-fe-access.log main; # 注意,在 Dockerfile 中创建 /admin-fe-access.log

#入口文件的设置
#location / {
# root /usr/share/nginx/html; #入口文件的所在目录
# index index.html index.htm; #默认入口文件名称
# try_files $uri $uri.html $uri/ =404;
#}
#error_page 404 /404.html;
location / {
root /usr/share/nginx/html; #入口文件的所在目录
index index.html index.htm; #默认入口文件名称
try_files $uri $uri.html $uri/ =404;
}
# error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root html;
#}
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# root html;
# }

}

# https 配置
server {
#SSL 默认访问端口号为 443
listen 443 ssl;
#请填写绑定证书的域名
server_name promonkeyli.top;
#请填写证书文件的相对路径或绝对路径
ssl_certificate /etc/nginx/certs/promonkeyli.top_bundle.crt;
#请填写私钥文件的相对路径或绝对路径
ssl_certificate_key /etc/nginx/certs/promonkeyli.top.key;
ssl_session_timeout 5m;
#请按照以下协议配置
ssl_protocols TLSv1.2 TLSv1.3;
#请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location / {
#网站主页路径。此路径仅供参考,具体请您按照实际目录操作。
#例如,您的网站主页在 Nginx 服务器的 /etc/www 目录下,则请修改 root 后面的 html 为 /etc/www。
root /usr/share/nginx/html; #入口文件的所在目录
index index.html index.htm; #默认入口文件名称
try_files $uri $uri.html $uri/ =404;
}
}
# server {
# #SSL 默认访问端口号为 443
# listen 443 ssl;
# #请填写绑定证书的域名
# server_name promonkeyli.top;
# #请填写证书文件的相对路径或绝对路径
# ssl_certificate /etc/nginx/certs/promonkeyli.top_bundle.crt;
# #请填写私钥文件的相对路径或绝对路径
# ssl_certificate_key /etc/nginx/certs/promonkeyli.top.key;
# ssl_session_timeout 5m;
# #请按照以下协议配置
# ssl_protocols TLSv1.2 TLSv1.3;
# #请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
# ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
# ssl_prefer_server_ciphers on;
# location / {
# #网站主页路径。此路径仅供参考,具体请您按照实际目录操作。
# #例如,您的网站主页在 Nginx 服务器的 /etc/www 目录下,则请修改 root 后面的 html 为 /etc/www。
# root /usr/share/nginx/html; #入口文件的所在目录
# index index.html index.htm; #默认入口文件名称
# try_files $uri $uri.html $uri/ =404;
# }
# }
# }

}

0 comments on commit d11306e

Please sign in to comment.