场景
基础信息 | |||
部署端口 | 部署路径 | 部署要求(http,https) | |
前端 | 8888 | /home/web | 访问路径: 场景二:http://192.13.14.115:8888/new |
后端 | 1088 | /home/service | 访问路径: 场景二:http://192.13.14.115:8888/service |
nginx 配置脚本
https
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
#监听端口
listen 82 ssl;
server_name localhost;
#证书
ssl_certificate /home/web/cert/bundle.crt;
#证书密钥
ssl_certificate_key /home/web/cert/bundle.key;
ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#支持的加密算法
ssl_prefer_server_ciphers on;
#方式一
#
#项目的前端配置
#访问:http://192.13.14.115:8888
location / {
root /home/web/dist;
index index.html;
}
#访问:http://192.13.14.115:8888/new
location /new {
alias /home/web/dist;
index index.html;
}
#访问:http://192.13.14.115:8888/service
location /service {
proxy_pass http://192.13.14.115:1088/;
}
}
}
http
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
#监听端口
listen 82;
server_name localhost;
#方式一
#
#项目的前端配置
#访问:http://192.13.14.115:8888
location / {
root /home/web/dist;
index index.html;
}
#访问:http://192.13.14.115:8888/new
location /new {
alias /home/web/dist;
index index.html;
}
#访问:http://192.13.14.115:8888/service
location /service {
proxy_pass http://192.13.14.115:1088/;
}
}
}