Nginx as Reverse Proxy for multiple servers binded to proxy using UNIX sockets - how to reached in LAN

Stefan Müller stefan.mueller.83 at gmail.com
Sun Oct 7 19:42:51 UTC 2018


good evening,

in the past we were mailing each other on a daily base but now it is 
silent. Anything alright?

On 03.10.2018 23:02, Stefan Müller wrote:
>
> thank you again for you quick answer  but I'm getting lost
>
>
>> A typical nginx configuration has only one http {} block.
>>
>> You can look at some examples:
> I'm aware of those and other examples. What confuses me that you say 
> that but also said in the email before that one:
>
>> If you put everything (both the user unix sockets and also the parent proxy server) under the same http{} block then it makes no sense since a single instance of nginx always runs under the same user (and beats the whole user/app isolation).
>
> so how must be the setup to the the whole user/app isolation
>
> nginx.pid  - master process
> \_nginx.conf
>   \_http{}  - master server
>   \_http{}  - proxied/app servers
>
> or
>
> nginx.pid  - master process
> \_nginx1.conf - master server
>   \_http{}   - reverse proxy server
> \_nginx2.conf - proxied servers
>   \_http{}   - proxied/app servers
>
> or?
>
> If it is only one nginx.pid, how to I need to configure it to run 
> nginx1.conf and nginx2.conf?
>
>
>
>> Unless by "router" you mean the same Synology box you can't proxy unix sockets over TCP, they work only inside a single server/machine.
> I mean my fibre router and I'm aware that unix sockets  work only 
> inside a single server/machine. I'll use it only to redirect to the 
> DNS Server what will run on the Synology box
>
>
>   
>> Also you don't need to forward multiple ports, just 80 and 443 (if ssl) and have name-based virtualhosts.
>
> you got me, I have mistaken that, it got to late last night
>
>
> On 03.10.2018 02:09, Reinis Rozitis wrote:
>>> so all goes in the same nginx.conf but in different http{} block or do I need one nginx.conf  for each, the user unix sockets and also the parent proxy server?
>> A typical nginx configuration has only one http {} block.
>>
>> You can look at some examples:
>> https://nginx.org/en/docs/http/request_processing.html
>> https://nginx.org/en/docs/http/server_names.html  
>> https://www.nginx.com/resources/wiki/start/topics/examples/server_blocks/
>>
>>
>>> You suggesting to setup virtualhosts what listen to a port whereto traffic is forwarded from the router. I don't to have multiple ports open at the router, so I would like to stick with UNIX Sockets and proxy.
>> Unless by "router" you mean the same Synology box you can't proxy unix sockets over TCP, they work only inside a single server/machine.
>>
>> Also you don't need to forward multiple ports, just 80 and 443 (if ssl) and have name-based virtualhosts.
>>
>> rr
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx


More information about the nginx mailing list