3 Star 23 Fork 10

Admin / leyou

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
nginx.conf 2.78 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
Admin 提交于 2019-11-08 19:55 . 微信支付
#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;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
server_name www.leyou.com;
location /item {
# 先找本地
root html;
if (!-f $request_filename) { #请求的文件不存在,就反向代理
proxy_pass http://127.0.0.1:8084;
break;
}
}
location / {
proxy_pass http://127.0.0.1:9002;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#配置manage.leyou.com访问前端项目
server {
listen 80;
server_name manage.leyou.com;
location / {
proxy_pass http://127.0.0.1:9001;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#配置api.leyou.com访问网关
server {
listen 80;
server_name api.leyou.com;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
#上传路径映射 api.leyou.com/api/upload/image
location /api/upload {
proxy_pass http://127.0.0.1:8082;
#路径重写 重写后去掉api前缀 http://127.0.0.1:8082:upload/image
rewrite "^/api/(.*)$" /$1 break;
}
location / {
proxy_pass http://127.0.0.1:10010;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#配置图片资源目录
server {
listen 80;
server_name image.leyou.com;
location / {
root D:\\Download;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
Java
1
https://gitee.com/jiangli31346337/leyou.git
git@gitee.com:jiangli31346337/leyou.git
jiangli31346337
leyou
leyou
master

搜索帮助

14c37bed 8189591 565d56ea 8189591