3 Star 15 Fork 8

Admin / leyou

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
nginx.conf 2.78 KB
Copy Edit Web IDE Raw Blame History
Admin authored 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;
}
}
}

Comment ( 0 )

Sign in for post a comment

Java
1
https://gitee.com/jiangli31346337/leyou.git
git@gitee.com:jiangli31346337/leyou.git
jiangli31346337
leyou
leyou
master

Search