码迷,mamicode.com
首页 > 其他好文 > 详细

vue项目部署nginx,配置

时间:2019-07-10 18:45:06      阅读:340      评论:0      收藏:0      [点我收藏+]

标签:for   inf   access   include   后台   oca   erer   error_log   class   

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
    #                  ‘$status $body_bytes_sent "$http_referer" ‘
    #                  ‘"$http_user_agent" "$http_x_forwarded_for"‘;

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
	#include reverse-procy.conf;
    server {#vue前端页面访问ip,端口
        listen       8090;
        server_name  10.9.1.179;
		
		default_type ‘text/html‘;
		
        charset utf-8;

        location / {#vue项目打包资源路径
            root   E:/javaworkspace/project/rbApi/dist;
            index  index.html;
        }
		
		location /api/ {#Java后台接口,比如:http://10.9.1.179:8082/api/updateAnnouncement;
			proxy_pass http://10.9.1.179:8082;
			
			
		}

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }



    }
	server {#映射端口Java后台服务器真正的端口
        listen       8082;
        server_name  10.9.1.179;
		
		default_type ‘text/html‘;
		
        charset utf-8;

        location / {
            root   html;
            index  getstep.html index.html index.htm;
        }
		
		location /api/ {#Java服务器项目服务地址
			proxy_pass http://10.9.1.179:8071;
			
			
			
		}

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }



    }

}

  

vue项目部署nginx,配置

标签:for   inf   access   include   后台   oca   erer   error_log   class   

原文地址:https://www.cnblogs.com/lazyli/p/11165464.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!