add tech conf
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
server {
|
||||
# https://serverfault.com/questions/798734/use-variable-for-server-name-in-nginx#
|
||||
# server_name $servername;
|
||||
server_name "tech.huiwings.cn";
|
||||
listen 443 ssl;
|
||||
client_max_body_size 10M;
|
||||
|
||||
set $resty_loc "/usr/local/openresty";
|
||||
|
||||
# disable in local test env
|
||||
ssl_certificate /etc/letsencrypt/live/huiwings.cn/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/huiwings.cn/privkey.pem; # managed by Certbot
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
proxy_set_header Host "tech.huiwings.cn";
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
# disable in local test env
|
||||
proxy_set_header X-Forwarded-Proto https;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
||||
}
|
||||
|
||||
root $resty_loc/nginx/html/tech-blog;
|
||||
index index.html;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name "tech.huiwings.cn";
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user