Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request help: proxy_pass cannot use https #5847

Closed
Horus-K opened this issue Dec 17, 2021 · 7 comments
Closed

request help: proxy_pass cannot use https #5847

Horus-K opened this issue Dec 17, 2021 · 7 comments

Comments

@Horus-K
Copy link

Horus-K commented Dec 17, 2021

Issue description

image
nginx returen 502
image
route use force https
image

apisix log:
2021/12/17 14:00:15 [error] 51#51: 7848975 [lua] init.lua:157: http_ssl_phase(): failed to fetch ssl config: failed to find SNI: please check if the client requests via IP or uses an outdated protocol. If you need to report an issue, provide a packet capture file of the TLS handshake., context: ssl_certificate_by_lua, client: xxxxxx, server: 0.0.0.0:9443

Environment

  • apisix version 2.10.2:
  • OS centos7.9:
  • OpenResty / Nginx version (cmd: nginx -V or openresty -V):
  • etcd version, 3.4.0
  • apisix-dashboard version, 2.9
@Horus-K
Copy link
Author

Horus-K commented Dec 17, 2021

If proxy_pass uses http, then the route cannot be enabled to force https, otherwise there will be too many 301 redirects

@Horus-K
Copy link
Author

Horus-K commented Dec 17, 2021

I used ingress-nginx to start force https, return code 308, proxy_pass can use https
On apisix, I used https forwarding and set ret_code 308. In the end, proxy_pass still redirected too many 301 and was not accessible

@Horus-K
Copy link
Author

Horus-K commented Dec 17, 2021

i see this #2257 but ret_code still not work
image
image

@tokers
Copy link
Contributor

tokers commented Dec 19, 2021

Please describe your architecture elaborately.

@Horus-K
Copy link
Author

Horus-K commented Dec 20, 2021

Please describe your architecture elaborately.

We have 5 nginx online servers, we need to use proxy_pass to gray some traffic to apisix

@Horus-K
Copy link
Author

Horus-K commented Dec 20, 2021

Please describe your architecture elaborately.

And I need to know how to use proxy_pass https

@Horus-K
Copy link
Author

Horus-K commented Dec 20, 2021

location / {
    index index.html;
    proxy_pass https://xxxxxxx.com;

    proxy_set_header Host $proxy_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_ssl_session_reuse off;
    proxy_ssl_server_name on;
    proxy_ssl_name $proxy_host;
    proxy_ssl_protocols TLSv1.2;
}  that's it

@Horus-K Horus-K closed this as completed Dec 20, 2021
@Horus-K Horus-K reopened this Dec 20, 2021
@Horus-K Horus-K closed this as completed Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants