nginx配置多个静态资源
Posted aqicheng
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx配置多个静态资源相关的知识,希望对你有一定的参考价值。
server listen 80 default_server; listen [::]:80 default_server; server_name backtest.chuanyuexizang.com; root /usr/share/nginx/html; rewrite ^(.*) https://$host$1 permanent;# HTTP强转HTTPS include /etc/nginx/default.d/*.conf; error_page 404 /404.html; location = /40x.html error_page 500 502 503 504 /50x.html; location = /50x.html server listen 443 ssl; server_name backtest.chuanyuexizang.com; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_certificate ssl/1_backtest.chuanyuexizang.com_bundle.crt; # 公钥目录 ssl_certificate_key ssl/2_backtest.chuanyuexizang.com.key; # 私钥目录 ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location /www1 alias /usr/share/nginx/html; index index.html index.php index.htm; location /www2 alias /usr/share/nginx/dist; index index.html index.php index.htm; location ~ .*\\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt)$ root /usr/share/nginx/; proxy_temp_path /usr/share/nginx/; location /admin proxy_pass http://127.0.0.1:9019/; proxy_set_header Host $host:$server_port;
以上是关于nginx配置多个静态资源的主要内容,如果未能解决你的问题,请参考以下文章