events {
worker_connections  1024;
}
http {
include      pes;
default_type  application/octet-stream;
sendfile        on;
tcp_nopush    on;
keepalive_timeout  90;
gzip on;
gzip_min_length 2k;
gzip_buffers  4 32k;
gzip_http_version 1.1;
gzip_comp_level 6;
gzip_types text/plain text/css text/javascriptapplication/json application/j                                                      avascript application/x-javascriptapplication/xml;    gzip_vary on;
gzip_proxied any;
access_log off;
server {
listen      9009;  #// 开发的端⼝
server_name  ;
#charset koi8-r;
#access_log  logs/host.access.log  main;
#// jenkins 配置, 记得配置⼀下Jenkins war服务的前缀为 "jenkins/"
#// 访问路径为 xxxxx:9009/jenkins
location /jenkins/
{
proxy_redirect off;
# proxy_set_header Host $host;
proxy_set_header Host $host:$server_port; #$server_port
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Nginx-Proxy true;
proxy_pass localhost:8080/jenkins/;
}
#// SpringBoot 微服务 boot-service-api 的swagger访问路径,端⼝8081  context-path: /boot-service-api
#// 访问路径为 xxxxx:9009/boot-service-api/swagger/swagger-ui.html
location /boot-service-api/swagger/
{
proxy_redirect off;
# proxy_set_header Host $host;
proxy_set_header Host $host:$server_port; #添加:$server_port
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass localhost:8081/boot-service-api/;
}
#// SpringBoot 前端页⾯VUE的访问路径
#// 访问路径为 xxxxx:9009/boot-service-vue
location /boot-service-vue
{
#// vue 静态页⾯⽂件的存放位置
nginx部署前端项目alias  /opt/vue/boot-service-vue/dist/;
index  index.html index.htm;
}
#// SpringBoot 微服务 boot-service-api 的访问路径
#// 访问路径为 xxxxx:9009/boot-service-api
location /boot-service-api/api/
{
proxy_redirect off;
# proxy_set_header Host $host;
proxy_set_header Host $host:$server_port; #$server_port
proxy_set_header X-Real-IP $remote_addr;

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。