You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "wzhlinux (via GitHub)" <gi...@apache.org> on 2024/11/18 02:13:32 UTC
[I] bug: using the http to https plug, https redirects appear with 301 or 308 [apisix]
wzhlinux opened a new issue, #11751:
URL: https://github.com/apache/apisix/issues/11751
### Current Behavior
My route configuration
`{
"name": "smarteye-he-microapp.gwm.cn-/*",
"host": "smarteye-he-microapp.gwm.cn",
"plugins": {
"redirect": {
"http_to_https": true,
"ret_code": 302,
"append_query_string": false,
"encode_uri": false
}
},
"uri": "/*",
"status": 1,
"id": "00000000000000001159",
"labels": {
"env": "test",
"founder": "gw00229948",
"applicant": "严新是(gw00302320)",
"appkey": "smarteye.smarteye-hmr.ui.miniapp-manage"
},
"priority": 1,
"enable_websocket": true,
"upstream_id": "00000000000000001157"
}`
access_log:
{"time": "15/Nov/2024:23:57:02 +0800","remote_addr": "10.248.67.29","host": "smarteye-he-microapp.gwm.cn",**"status": "301"**,"request_uri": "/","request_method": "GET","request_time": "0.000","request_length": "209","body_bytes_sent": "241","bytes_sent": "441",**"upstream_addr": "-"**,"upstream_status": "-","upstream_response_length": "-","upstream_response_time": "-","server_name": "_","server_protocol": "HTTP/1.0","http_referer": "-","remote_user": "-","http_user_agent": "-","http_x_forwarded_for": "154.213.184.43, 10.248.65.252","tcpinfo_rtt": "133253","tcpinfo_rttvar": "28516","tcpinfo_snd_cwnd": "10","tcpinfo_rcv_space": "7300","connection": "10116981417","connection_requests": "1",**"scheme": "https"**,"ssl_session_reused": ".","ssl_cipher": "ECDHE-RSA-AES128-GCM-SHA256"}
### Expected Behavior
use https request host,redirects 301 or 308
Remove redirects plugins Restoring health。
### Error Logs
Unexpected error log
### Steps to Reproduce
Some business feedback, but failed to reproduce
### Environment
- APISIX version (run `apisix version`): 3.2.2
- Operating system (run `uname -a`):
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: using the http to https plug, https redirects appear with 301 or 308 [apisix]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #11751:
URL: https://github.com/apache/apisix/issues/11751#issuecomment-2903750041
Check that the request contains the correct X-Forwarded-Proto header, or add debug logging to the redirect plugin to output the values of proxy_proto and _scheme.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: using the http to https plug, https redirects appear with 301 or 308 [apisix]
Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung commented on issue #11751:
URL: https://github.com/apache/apisix/issues/11751#issuecomment-3190437243
@wzhlinux It seems this issue is similar to #12500, please help to confirm. Your description is vague.
If they are the same, I will close this issue and reply in #12500.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: using the http to https plug, https redirects appear with 301 or 308 [apisix]
Posted by "wzhlinux (via GitHub)" <gi...@apache.org>.
wzhlinux commented on issue #11751:
URL: https://github.com/apache/apisix/issues/11751#issuecomment-2490238508
Found the problem, it's caused by this line of code。use scheme
` local proxy_proto = core.request.header(ctx, "X-Forwarded-Proto")
local _scheme = proxy_proto or core.request.get_scheme(ctx)
if conf.http_to_https and _scheme == "http" then`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] bug: using the http to https plug, https redirects appear with 301 or 308 [apisix]
Posted by "SkyeYoung (via GitHub)" <gi...@apache.org>.
SkyeYoung closed issue #11751: bug: using the http to https plug, https redirects appear with 301 or 308
URL: https://github.com/apache/apisix/issues/11751
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org