提交 e7f17258 编写于 作者: 小傅哥's avatar 小傅哥

feat: ssl nginx 部署

上级 bc939f11
version: '3'
# docker-compose -f docker-compose.yml up -d
services:
nginx:
image: nginx:1.25.3
container_name: nginx
ports:
- '443:443'
- '80:80'
volumes:
- ./nginx/logs:/var/log/nginx
- ./nginx/html:/usr/share/nginx/html
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/conf/conf.d:/etc/nginx/conf.d
- ./nginx/ssl:/etc/nginx/ssl/
privileged: true
restart: always
\ No newline at end of file
server {
listen 80;
listen [::]:80;
location / {
root /usr/share/nginx/html;
index index.html;
}
location /api {
root /usr/share/nginx/html;
index index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
\ No newline at end of file
server {
listen 80;
listen [::]:80;
server_name ssl01.xiaofuge.tech;
rewrite ^(.*) https://$server_name$1 permanent;
}
server {
listen 443 ssl;
server_name ssl01.xiaofuge.tech;
ssl_certificate /etc/nginx/ssl/_.xiaofuge.tech.pem;
ssl_certificate_key /etc/nginx/ssl/_.xiaofuge.tech.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
\ No newline at end of file
server {
listen 80;
listen [::]:80;
server_name ssl02.xiaofuge.tech;
rewrite ^(.*) https://$server_name$1 permanent;
}
server {
listen 443 ssl;
server_name ssl02.xiaofuge.tech;
ssl_certificate /etc/nginx/ssl/_.xiaofuge.tech.pem;
ssl_certificate_key /etc/nginx/ssl/_.xiaofuge.tech.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
\ No newline at end of file
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Nginx - 小傅哥</title>
</head>
<body>
Hi Body Congratulations on your successful deployment!
</body>
</html>
\ No newline at end of file
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAriY2Z98ZhbbYSQVYca+NGYhhe0q+7uAuhEfUMIzZig8LITB0
0+sscR6WH/cTfTyo7TCb5aO5dppqxoaE3+ABoXCC+ggWkFIj/MtObgc+7dcjH/E3
U6caeBWR48PQc7sYwI2BKNdJm2T8AEmrjd9q2Kfg0BovdJtxeQE1g9p76pru4gqp
EGMPvVDZSaL5LWU1p6Y2fvfOpHKEK0kQhTHoRqCl/01P7AzFkAv38aZ35ZfDZG78
dFJ93NPBuXFg4VzMB9Bm/pNQKfCR3ebm+KcKMT9ylsZvlpAsZRyB8GF1qX2g8Zl6
iqx7pmpGg2xc+96Mbn0GCHj5vLRo7DddfXrtWQIDAQABAoIBADt+r4iV9fyyBjsQ
GfKg5GYMKy15UDiAmzOy7GF3xRv+3rEEgm0hw2mT5vrdqKlY72c0+5Wc9Q/5WjAf
pcZsG3KBYyWzXK4KeePzuwQo8o1DuerAOE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IArAoyZl+tJaox118fessmXn1hIVw41oeQa1v1vg4Fv74zPl6/AhSrw
9U5pCZEt4Wi4wStz6dTZ/CLANx8LZh1J7QJVj2fhMtfTJr9w4z30Z209fOU0iOMy
+qduBmpvvYuR7hZL6Dupszfnw0Skfths18dG9ZKb59UhvmaSGZRVbNQpsg3BZlvi
d0lIKO2d1xozclOzgjXPYovJJIultzkMu34qQb9Sz/yilrbCgj8=
-----END CERTIFICATE-----
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册