更新头像功能 修改nginx相关配置


// 更新头像功能 路径不同,需要修改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/ { #请求路径中凡是以/user/开头的请求,转发到sso系统

client_max_body_size 300m; #设置最大的请求体大小,解决大文件上传不了的问题

proxy_connect_timeout 300s; #代理连接超时时间

proxy_send_timeout 300s; #代理发送数据的超时时间

proxy_read_timeout 300s; #代理读取数据的超时时间

proxy_pass http://127.0.0.1:18080; #转发请求

}

location /users/header { #请求路径中凡是以/user/header开头的请求,转发到sso系统

client_max_body_size 300m; #设置最大的请求体大小,解决大文件上传不了的问题

proxy_connect_timeout 300s; #代理连接超时时间

proxy_send_timeout 300s; #代理发送数据的超时时间

proxy_read_timeout 300s; #代理读取数据的超时时间

proxy_pass http://127.0.0.1:18080; #转发请求

}

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; #转发请求到server系统

}

}

}

发表评论
留言与评论(共有 0 条评论) “”
   
验证码:

相关文章

推荐文章