You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "ronnybremer (via GitHub)" <gi...@apache.org> on 2024/07/16 15:43:09 UTC
[I] bug: APISIX sends wrong redirect to browser when upstream is HTTP (SSL termination) [apisix]
ronnybremer opened a new issue, #11408:
URL: https://github.com/apache/apisix/issues/11408
### Current Behavior
Configured SSL on APISIX and using HTTP for an upstream node. The upstream server (Apache 2.4) is sending back a redirect, when the user omits the trailing "/" slash on an url, like http://backend.demo.org/blog will be redirected to http://backend.demo.org/blog/ with a status code of 301 (moved permanently).
APISIX is sending the redirect to the client with the wrong scheme, http://demo.org:9443/blog/ will be sent instead of https://demo.org:9443/blog/ causing further communication to fail.
### Expected Behavior
When acting as an SSL termination proxy, APISIX should return the correct scheme, independent of the backend's response. The redirect should be https://demo.org:9443/blog/ even for HTTP only upstream nodes.
### Error Logs
_No response_
### Steps to Reproduce
1. Run APISIX via Docker image
2. configure standalone mode (I am no sure if it also occurs in traditional mode)
3. set SSL certificate for APISIX and listen on port 9443
4. configure a route for URIs "/blog" and "/blog/*" to point to a HTTP only node
5. use Apache 2.4 as the upstream HTTP only node, listening on port 80
6. make a directory called "blog" and touch a file "1.html" inside
7. access https://demo.org:9443/blog/1.html and verify that the page is retrieved
8. access https://demo.org:9443/blog and see the returned redirect as http://demo.org:9443/blog/
### Environment
- APISIX version (run `apisix version`): 3.9.1 official docker image
- Operating system (run `uname -a`): Rocky Linux 8
- 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: APISIX sends wrong redirect to browser when upstream is HTTP (SSL termination) [apisix]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop closed issue #11408: bug: APISIX sends wrong redirect to browser when upstream is HTTP (SSL termination)
URL: https://github.com/apache/apisix/issues/11408
--
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: APISIX sends wrong redirect to browser when upstream is HTTP (SSL termination) [apisix]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #11408:
URL: https://github.com/apache/apisix/issues/11408#issuecomment-3995210171
You can use the following plugin configuration to achieve similar functionality.
```
{
plugins: {
response-rewrite: {
headers: {
set: {
Location: $regex_replace($http_location, '^http://', 'https://')
}
},
vars: [
[status, ~~, ^30[12378]$],
[http_location, ~~, ^http://]
]
}
}
}
```
--
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: APISIX sends wrong redirect to browser when upstream is HTTP (SSL termination) [apisix]
Posted by "Bqiwezz (via GitHub)" <gi...@apache.org>.
Bqiwezz commented on issue #11408:
URL: https://github.com/apache/apisix/issues/11408#issuecomment-2625218165
u need result is gateway(https) route to http for make http to https?
I allready have a problem like this i have cert wildcard to make gateway https but every i set route after i curl it will error ssl
I reslove by set route to port 443 and set to set up cert if you use api-six dashboard to upload certificate it looking good but it not accuracy work i change method to add a cert wildcard by using curl and i variable "SNI" it must be only "*.abc-domain" if you have wildcard after that in mycase it slove problem for or if you have a 1 domain "sni" you must already have 1
--
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: APISIX sends wrong redirect to browser when upstream is HTTP (SSL termination) [apisix]
Posted by "zwtesttt (via GitHub)" <gi...@apache.org>.
zwtesttt commented on issue #11408:
URL: https://github.com/apache/apisix/issues/11408#issuecomment-2232695951
Have you tried using “/blog*”?
--
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: APISIX sends wrong redirect to browser when upstream is HTTP (SSL termination) [apisix]
Posted by "Baoyuantop (via GitHub)" <gi...@apache.org>.
Baoyuantop commented on issue #11408:
URL: https://github.com/apache/apisix/issues/11408#issuecomment-3995217366
If there is still a problem, please open it again.
--
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