// 更新頭像功能 路徑不同,需要修改nginx配置和定義Controller
修改nginx配置 操作 定義Controller 在下一遍
#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;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location /user/ { #請(qǐng)求路徑中凡是以/user/開頭的請(qǐng)求,轉(zhuǎn)發(fā)到sso系統(tǒng)
client_max_body_size 300m; #設(shè)置最大的請(qǐng)求體大小,解決大文件上傳不了的問題
proxy_connect_timeout 300s; #代理連接超時(shí)時(shí)間
proxy_send_timeout 300s; #代理發(fā)送數(shù)據(jù)的超時(shí)時(shí)間
proxy_read_timeout 300s; #代理讀取數(shù)據(jù)的超時(shí)時(shí)間
proxy_pass http://127.0.0.1:18080; #轉(zhuǎn)發(fā)請(qǐng)求
}
location /users/header { #請(qǐng)求路徑中凡是以/user/header開頭的請(qǐng)求,轉(zhuǎn)發(fā)到sso系統(tǒng)
client_max_body_size 300m; #設(shè)置最大的請(qǐng)求體大小,解決大文件上傳不了的問題
proxy_connect_timeout 300s; #代理連接超時(shí)時(shí)間
proxy_send_timeout 300s; #代理發(fā)送數(shù)據(jù)的超時(shí)時(shí)間
proxy_read_timeout 300s; #代理讀取數(shù)據(jù)的超時(shí)時(shí)間
proxy_pass http://127.0.0.1:18080; #轉(zhuǎn)發(fā)請(qǐng)求
}
location / { #上面未匹配到的在這里處理
client_max_body_size 300m;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
proxy_pass http://127.0.0.1:18081; #轉(zhuǎn)發(fā)請(qǐng)求到server系統(tǒng)
}
}
}