Skip to content

Commit

Permalink
add nginx ssl remark
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaopan committed Jun 8, 2024
1 parent c6fe531 commit 476a91e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
15 changes: 13 additions & 2 deletions nginx/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#nginx
# nginx

## Usage

Expand All @@ -23,8 +23,19 @@ chmod -R 600 nginx/ssl
###
ssl_certificate ssl/<domain>.com.pem;
ssl_certificate_key ssl/<domain>.com.key;
```

nginx shell

```
```bash
# 验证配置文件问题
nginx -t

# 重载 Nginx
nginx -s reload

# eg:

docker exec -it nginx nginx -t
docker exec -it nginx nginx -s reload
```
10 changes: 2 additions & 8 deletions nginx/conf.d/default.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ server {
charset utf-8;
default_type text/html;

#将所有HTTP请求通过rewrite指令重定向到HTTPS。
#rewrite ^(.*)$ https://$host$1;

location / {
root /var/www;
index index.html index.htm;
autoindex on;
}
#把http的域名请求转成https
return 301 https://$host$request_uri;
}

server {
Expand Down

0 comments on commit 476a91e

Please sign in to comment.