本文共 876 字,大约阅读时间需要 2 分钟。
nginx +tomcat 实现动静分离
nginx 配置如下:upstream autowebgateway {
server 127.0.0.1:8081;} server { listen 80 default;listen 443 ssl;server_name localhost;ssl_certificate server.pem;ssl_certificate_key server.key;ssl_session_timeout 5m;ssl_protocols TLSv1 TLSv1.1 TLSv1.2;ssl_ciphers HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM;ssl_prefer_server_ciphers on;location / {proxy_pass http://10.24.39.205:8088; #反代tomcat web服务 } location /autowebgateway/ { #反代tomcat 动态服务 proxy_pass http://autowebgateway;
#域名+路径访问形式:
location /anliandbc { root /html;index index.html;try_files $uri $uri/ /anliandbc/index.html;}#域名+两层路径访问形式: location /m/cctvfestival { alias /html/m/cctifestival;index index.html;try_files $uri $uri/ /m/cctvfestival/index.html;}}转载于:https://blog.51cto.com/lookingdream/2045137