Comments (2)
https不支持ip
from itranswarp.
我目前只想用ip来打开界面。
不知道是不是我配置不对还是什么的 。每次刷新页面静态文件老是指向https,如下图
我的nginx配置,如下
upstream itw_upstream {
server 127.0.0.1:2019 fail_timeout=3s;
}http
server {
listen 80; server_name localhost; #rewrite ^(.*)$ http://127.0.0.1:2019 permanent; root /usr/share/nginx/html; access_log /var/log/nginx/host.access.log; error_log /var/log/nginx/host.error.log; client_max_body_size 2m; gzip on; gzip_min_length 1k; gzip_buffers 4 8k; gzip_http_version 1.1; gzip_comp_level 1; gzip_types text/css application/x-javascript application/json; sendfile on; location = /favicocan.ico { expires 10d; } location = /robots.txt { expires 10d; }
location ~ /static/ {
if ($request_method ~* "(GET|POST)") {
add_header "Access-Control-Allow-Origin" *;
}if ($request_method = OPTIONS ) { add_header "Access-Control-Allow-Origin" "http://127.0.0.1:2019"; add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD"; add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept"; expires 300d; return 200; } proxy_pass http://127.0.0.1:2019; proxy_read_timeout 3s; } location ~ /files/ { if ($request_method ~* "(GET|POST)") { add_header "Access-Control-Allow-Origin" *; } if ($request_method = OPTIONS ) { add_header "Access-Control-Allow-Origin" "http://118.25.135.7:2019"; add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, HEAD"; add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept"; expires 300d; return 200; } proxy_pass http://127.0.0.1:2019; proxy_read_timeout 3s; } location / { if ($http_user_agent ~* "python|curl|java|wget|httpclient|okhttp") { return 503; } proxy_pass http://itw_upstream; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }
}
我也是出现这个问题, 用ip访问时, 静态文件全部变成了https请求, 导致全部报错.
作者答非所问. 请问您解决了吗?
from itranswarp.
Related Issues (20)
- bundle.js太大,耗时30s HOT 7
- 标签功能 HOT 2
- dao层支持like功能吗? HOT 1
- RediSearch中文搜索不到结果,但是英文可以 HOT 1
- About Quick Start Guide, Visit it doesn't work after Step 3
- 有总的页面访问统计和用户访问统计功能吗? HOT 1
- Discuss topic number count negative after deleted sample HOT 1
- 网站语言切换没有反应 HOT 3
- 上传图片功能经常失效 HOT 6
- 前端用了vue,为什么还要使用pebble模板引擎呢? HOT 1
- 怎么设置https 证书 我看web服务器好像在docker里 HOT 3
- 怎么添加注册功能,后续怎么升级 HOT 1
- 微信帐号无法使用吗 HOT 1
- 搜索功能-关键词文件明明包含关键词,但是分词的时候找不到关键词? HOT 1
- 有专门上传图片的功能吗? HOT 1
- 我自己实现了谷歌注册部分的代码 可以建个分支推送上去嘛 HOT 2
- RediSearch创建多个索引之后,io.lettuce.core.api.sync.RedisHashCommands#hset写数据不能指定索引名字,导致搜索结果不准确 HOT 1
- 登陆博客网站集成拓展 HOT 1
- 博客目录折叠支持 HOT 1
- 支持随机查询ORDER BY RAND()吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itranswarp.