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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to