Hot answers tagged

6

Simple location prefix matching works for this without using a rewrite rule as long as you specify a URI in the proxy_pass directive: location /foo { proxy_pass http://localhost:3200/; } Notice the additional / at the end of the proxy_pass directive. NGINX will strip the matched prefix /foo and pass the remainder to the backend server at the URI /. ...


4

Unlike the previous one, the current version of nginx allows to create multiple sub filter rules under one location directive. Like so location / { resolver 8.8.8.8; proxy_pass http://original-domain.com; proxy_set_header Accept-Encoding ""; proxy_set_header Host original-domain.com; subs_filter_types text/css text/xml text/css; ...


4

Nginx is being stopped from binding to SELinux pop_port_t ports. It possible is to alter the desired ports to be a type that nginx can bind to, e.g. http_port_t. # for port in {143,993,110,995} ; do semanage port -m -t http_port_t -p tcp $port ; done && semanage port -l -C SELinux Port Type Proto Port Number http_port_t ...


4

There's an apache module called mod_substitute that can do this. Here's a short example: <Location "/"> AddOutputFilterByType SUBSTITUTE text/html Substitute "s/uat.site.co.jp/jp.uat.site2uk.co.uk/ni" </Location> Or, when combined with mod_proxy: ProxyPass / http://uat.site.co.jp/ ProxyPassReverse / http://uat.site.co.jp/ Substitute ...


4

This is impossible. SSH has no notion of a Host header as is present in HTTP. The best you can do is port-based routing.


4

I suspect that your colleague misunderstood the ssl related directives: the file pointed to by ssl_certificate should contain your server's certificate followed by intermediate certificates, and ssl_client_certificate is only needed for client cert verification and OCSP - I think he copied the intermediate(s) into that file. Now, a browser that already has ...


3

What you're asking for is pretty much impossible, because the vast, vast majority of L7 protocols have no concept of a hostname, and thus can't be proxied based on a hostname The correct way to achieve what you want is to assign different public IP addresses, because even though you have a router in your diagram, it's actually NATting, which isn't routing ...


3

JavaScript Single-page apps often use a hash to handle navigation within the app (clicking on a link in the application might update the hash to https://example.com/springApp/#/foo/bar, for example). It's becoming less common as the HTML5 History API becomes well supported, though.


3

You could use multiple A records, one for each machine. But, regarding your high-availability tag: You won't get this via this technique. Alternatively, you could use Anycast or a Content delivery network aka CDN. SSL may be an issue. Basically can 1 cert work on multiple servers provided they have the same setup? Yes.


3

Varnish does not support SSL Running a site/service on SSL is a necessity for anything half serious, so thats one reason to use haproxy which will do SSL termination for you.


3

Doing any kind of proxying based on the DNS hostname used also requires that the application protocol carries the host header in some way. To my knowledge there are no such headers involved in FTP, so I don't see how this will be possible. Maybe with a custom FTP proxy, that sends you to different servers based on the username or something like that. TLDR: ...


3

If you haven't restarted Apache, be sure to do that, but if you've already done so, you could try a global output filter that runs a custom PHP script to do your replacing just to see if that solves it for some reason. EDIT: based on your comment, it could be that substitute isn't working because the content is compressed. To turn off compression, add ...


3

There is nothing special in the server log which shows a problem at the site of nginx. But, you description clearly indicates a problem in the clients network, i.e. only clients in the same network are affected all clients in the same network are affected if client connects to another network while experiencing the problem, the problem no longer occurs ...


3

"Server not found" from a browser often indicates a failure to resolve the host-name into an IP address. I notice that ubnt.aqtsolutions.com does not resolve, but the other two names do. It may be that your nginx configuration is fine and you just have a missing DNS entry.


3

After hours of research I got simple solution with little luck. proxy_html.conf file was missing. I have copied this file from apache2.2 to /etc/apache/mods-available and made link in mods-enabled pointing to this file. vi /etc/apache2/mods-available added these lines: # Here's the declaration for W3C HTML 4.01 and XHTML 1.0 ProxyHTMLLinks a ...


3

Basically, reverse proxies will hide your infrastructure from the world. So it is mainly a case of security by obscurity, unless your web server is really unmanageable and unsecured. It can also protect your webservers from some kind of DOS (distributed denial of service), especially if your website is "heavy", acting then as a caching layer. It has also ...


3

I noticed the issue occurs when the Proxy location path does not match the Tomcat application context name and there is a cookie path mismatch which causes a new JSESSIONID for every request. Try adding the proxy_cookie_path directive as mentioned below: location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For ...


3

I know i'm pretty late to the game, but for me this is the top result when searching for this problem, so i wanted to share my solution. This uses the if directive (with one of the few valid use cases) combined with the custom error handler: upstream backend { server backend1; server backend2; } server { server_name proxy; location / { ...


3

You can use sniproxy : https://github.com/dlundquist/sniproxy An example configuration : listener 0.0.0.0:443 { protocol tls table TableHTTPS fallback 127.0.0.1:8443 } listener 0.0.0.0:80 { protocol http table TableHTTP fallback 127.0.0.1:8080 } table TableHTTPS { domain1.com backend1:443 domain2.org backend2:443 } table ...


3

The Via header is designed for passing the blame on to someone else. It is perfectly acceptable to remove, or not generate it, if it doesn't serve that purpose.


3

Because you regex doesn't match. ^[A-Za-z0-9]$ matches URIs composed of one alphanumeric character and you didn't put any leading slash nor capture group. You need ProxyPassMatch ^/([A-Za-z0-9]+)$ https://example1.com/news-$1 instead.


2

Look in /var/www/chat/public/tmp/sockets/ - does thin.0.sock actually exist? As far as I know, Thin only supports TCP sockets, not Unix sockets. If you copied the Unix socket thing from a Unicorn-specific example, that would explain it, since Unicorn does support them. I suggest changing the upstream definition block to say server http://127.0.0.1:4567 or ...


2

You just need to create a new VirutalHost section for loremipsum.bar.com. It would look something like: <VirtualHost *:80> ProxyPass / http://www.acme.com:8760/Application ProxyPassReverse / http://www.acme.com:8760/Application ServerName loremipsum.bar.com </VirtualHost>


2

I have another way to achieve this, If you have have several things to upgrade on each server. That'll be very wasting to update 5 server for the same operations. Create a Load Balancing & Scaling Group.Ensure the connection draining is enabled. There's my upgrade step. Remove 1 instance from your load balancer. Update everything you need. And ...


2

May be because you don`t have A DNS record for ubnt.aqtsolutions.com nslookup ubnt.aqtsolutions.com 8.8.8.8 Server: 8.8.8.8 Address: 8.8.8.8#53 ** server can't find ubnt.aqtsolutions.com: NXDOMAIN


2

You can modify nginx proxy server configuration like this: server { server_name example.com; listen 80; location / { proxy_pass http://127.0.0.1:3001; } location /foo { proxy_pass http://127.0.0.1:3002; } } server { server_name example.org; listen 80; location / { proxy_pass ...


2

Change Host header from proxy_set_header Host $http_host; to proxy_set_header Host remote.example.com; Looks like I misinterpreted your sentences about document base. I thought it was a protection from java applet server so, it can't be downloaded unless we change the Host header. Apparently, document base that you ...


2

I believe your openssl version is the problem. The openssl group recommends version 1.01j minimum. Also, check your cipher. Isn't there supposed to be a colon before !RC4?


2

You are only guessing. Did you increase max connections on Tomcat and Apache? Did you increase the number of connections in you Tomcat apps DB connection pool and the max connections in PostgreSQL? Try increasing these 4 values and see what happens. Also Tomcat with 60GB ram isn't a good idea. Every once in a while every Java garbage collector (it doesn't ...


2

From my reading of the nginx websocket dock, when your nginx proxy sees the Upgrade headers, it passes them on to hack.chat. hack.chat then needs to respond with the 101 response. First of all, you want to be able to debug the actual HTTP and hack.chat transactions, so you know whether the problem is in your client app, or on the web server, or with the ...



Only top voted, non community-wiki answers of a minimum length are eligible