You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "ZhangShangyu (via GitHub)" <gi...@apache.org> on 2023/04/28 08:30:38 UTC

[GitHub] [apisix] ZhangShangyu opened a new issue, #9394: help request: does apisix support ssl_preread_protocol? can we use one port to serve both http and https?

ZhangShangyu opened a new issue, #9394:
URL: https://github.com/apache/apisix/issues/9394

   ### Description
   
   **Background**
   We want to use one port to serve both http and https due to the firewall rule restrict.
   For example: 8081 port can proxy both http and http schema, http://test.com:8081 and https://test.com:8081 can proxy to the same apisix upstream backend
   
   **Nginx solution**
   In native nginx can use ssl_preread_protocol to implement this requirement, refer to https://www.nginx.com/blog/running-non-ssl-protocols-over-ssl-port-nginx-1-15-2
   
   ```
   stream {
       upstream http {
           server unix:/var/run/nginx_http.sock;
       }
   
       upstream https {
           server unix:/var/run/nginx_https.sock;
       }
   
       map $ssl_preread_protocol $upstream {
           "" http;
           default https;
       }
   
       server {
           listen 8081;
           proxy_pass $upstream;
           ssl_preread on;
           proxy_protocol on;
       }
   }
   
   http {
       server {
           listen unix:/var/run/nginx_http.sock proxy_protocol;
           listen unix:/var/run/nginx_https.sock ssl proxy_protocol;
   
           location / {
               proxy_pass http://192.168.1.1:8080;
           }
       }
   }
   ```
   
   **so how can apisix solve this requirement?**
   
   thanks for help
   
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - 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


[GitHub] [apisix] xiaolei000129 commented on issue #9394: help request: does apisix support ssl_preread_protocol? can we use one port to serve both http and https?

Posted by "xiaolei000129 (via GitHub)" <gi...@apache.org>.
xiaolei000129 commented on issue #9394:
URL: https://github.com/apache/apisix/issues/9394#issuecomment-1556149864

   解决了吗?
   


-- 
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


[GitHub] [apisix] xiaolei000129 commented on issue #9394: help request: does apisix support ssl_preread_protocol? can we use one port to serve both http and https?

Posted by "xiaolei000129 (via GitHub)" <gi...@apache.org>.
xiaolei000129 commented on issue #9394:
URL: https://github.com/apache/apisix/issues/9394#issuecomment-1556150502

   解决了吗?我也遇到这个问题了,我们的前端是https 但是我的接口是http://xxx:9080/不知道怎么用https 现实


-- 
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


[GitHub] [apisix] xiaolei000129 commented on issue #9394: help request: does apisix support ssl_preread_protocol? can we use one port to serve both http and https?

Posted by "xiaolei000129 (via GitHub)" <gi...@apache.org>.
xiaolei000129 commented on issue #9394:
URL: https://github.com/apache/apisix/issues/9394#issuecomment-1569555800

   升级最新版本解决了问题


-- 
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