cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

"Host“ key in http header behind reverse Proxy over UNIX Socket is not available

"Host“ key in http header behind reverse Proxy over UNIX Socket is not available

WolfgangDannert
Established Member

Hello,

I connect my werbserver with the UNIX Socket to the Rexroth reverse Proxy. The header from each http request is changed from the proxy. Inside the header „Host“ (i.e. https://192.168.1.1:8443) key is not correct available. The „Host“ is needed for redirect to a default page. How can I get the Host from the reverse Proxy?

Is there any other behavior expexted than descriped in the RFC7230 Section 5.4?

https://tools.ietf.org/html/rfc7230#section-5.4

 

Thanks.

Best regards

8 REPLIES 8

CodeShepherd
Community Moderator
Community Moderator

Did you have a look in our SDK for ctrlX CORE? There is an example how to add your web server to the reverse proxy.

The general idea of it is to hide the ports used internally for communication but add a atring to the URL that defines your web server.

Thank you for your answer.

I looked into the SDK for ctrlX CORE. There I found only information about a connection via a port between the reverse proxy and a webserver.


My question refers to the UNIX socket communication between the reverse proxy and a web server being executed on the ctrlX.
Can I get information on that communication regarding the header content? Thanks.

Now I get the topic. I will check that with our R&D.

jochen-scheib
Established Member

Hi,

by default the reverse proxy is not forwarding the headers. But you have several options:

  • Add option "header_upstream" with value "Host {host}" if you only need the host header
  • Add option "transparent" with empty value (""), this will set the following headers:
    • Host, X-Real-IP. X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto

You can find an example snap on github, see package-manifest.json 

Hi,

thanks for the answer.

Hi,

In the example on Github, the option parameter "websocket" is also listed. Does this mean that a WebSocket connection from an service on the ctrlX can also by the reverse proxy provided? If so, does the reverse proxy make ws to a wss connection?

Thanks!

Best regards

WolfgangDannert

Hi,

yes you are right.

When websocket is set, the http(s) request will be upgraded between browser and reverse proxy if requested by client. The connection between browser and reverse Proxy is always secured with TLS, in your case websocket secure (wss) will be used.

So you can safely use http / ws between Server and Reverse Proxy as long as you ensure your server is only locally binded (e.g. using unix socket or loopback interface/localhost) and does not bypass using a seperate port.

Best regards

Jochen Scheib

Hello jochen-scheib,

Good to hear and thanks for the answer.


Best regards

WolfgangDannert

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist