server {
listen 8080;
server_name 192.168.1.00;
location / {
proxy_pass http://localhost:8080;
proxy_cookie_path / /;
proxy_set_header Host $http_host;
proxy_set_header Cookie $http_cookie;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_redirect off;
add_header Front-End-Https on;
add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT, DELETE';
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,
java 文件跨域(所遇问题访问上传文件请求文件路径只能在下载文件,不能在线预览),使用Nginx配置来解决
于 2024-03-09 09:43:09 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)