Home  >  Q&A  >  body text

nginx same port proxy problem

Background: For security reasons, the customer only allows the external server to open port 80. The system we deployed includes an IM module using the xmpp protocol. So there are the following questions.

The following is the access log of nginx:

192.168.1.113 - - [19/Mar/2015:17:08:42 +0800] "<?xml version=1.0\x22?>" 400 172 "-" "-"
192.168.1.113 - - [19/Mar/2015:17:08:46 +0800] "<?xml version=1.0\x22?>" 400 172 "-" "-"

Excuse me: How to write the nginx configuration file?

================

The following situations will be handled. This is the first time I encountered this situation.

192.168.1.113 - - [19/Mar/2015:17:08:42 +0800] "POST /http-bind HTTP/1.1" 400 172 "-" "-"
192.168.1.113 - - [19/Mar/2015:17:08:46 +0800] "POST /login HTTP/1.1" 400 172 "-" "-"
ringa_leeringa_lee2735 days ago477

reply all(2)I'll reply

  • 習慣沉默

    習慣沉默2017-05-16 17:27:04

    nginx does not support the XMPP protocol. You can use BOSH, but it requires client support.

    You can also write an nginx module to forward to the backend XMPP server when the request is XML. Of course, another solution is to add a code program written by yourself in front of nginx. Please transfer it to nginx or XMPP.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 17:27:04

    Why only open port 80? Even if it is forwarded by nginx... doesn't it also directly access XMPP? Does nginx do any authentication verification?

    In addition, nginx supports tcp proxy

    reply
    0
  • Cancelreply