系统相关
首页 > 系统相关> > nginx localtion 的alias是一个目录别名的定义,root则是最上层目录的定义

nginx localtion 的alias是一个目录别名的定义,root则是最上层目录的定义

作者:互联网

server {
listen 443 ssl;
server_name testmall.xxxx.com;

ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_protocols TLSv1.2;
ssl_ciphers 'AES128+EECDH:AES128+EDH';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
charset utf-8;

proxy_connect_timeout 180;
proxy_send_timeout 180;
proxy_read_timeout 180;
proxy_set_header Host $host;
proxy_set_header X-Forwarder-For $remote_addr;

root /home/nginx2/html;

location / {
try_files $uri $uri/ /index.html;
}

location ^~ /admin {
try_files $uri $uri/ /admin/index.html;
}

location ^~ /store {
try_files $uri $uri/ /store/index.html;
}

location ^~ /mobile {
try_files $uri $uri/ /mobile/index.html;
}

location ^~ /devmobile {
try_files $uri $uri/ /devmobile/index.html;
}

 

 

location ^~ xxx/mobile {
proxy_redirect off;
alias /home/nginx2/h5/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Scheme $scheme;
}

标签:set,定义,ssl,header,uri,alias,html,proxy,目录
来源: https://www.cnblogs.com/cheyunhua/p/16477549.html