proxypass

malformed HTTP response with docker private registry (v2) behind an nginx proxy

不羁岁月 提交于 2019-12-19 05:14:11
问题 I have setup a Docker private registry (v2) on a CentOS 7 box following their offical documentation: https://docs.docker.com/registry/deploying/ I am running docker 1.6.0 on a Fedora 21 box. The registry is running on port 5000, and is using an SSL key signed by a trusted CA. I set a DNS record for 'docker-registry.example.com' to be the internal IP of the server. Running 'docker pull docker-registry.example.com:5000/tag/image', it works as expected. I setup an nginx server, running nginx

Nginx proxy_pass with $remote_addr

痞子三分冷 提交于 2019-12-18 11:00:30
问题 I'm trying to include $remote_addr or $http_remote_addr on my proxy_pass without success. The rewrite rule works location ^~ /freegeoip/ { rewrite ^ http://freegeoip.net/json/$remote_addr last; } The proxy_pass without the $remote_addr works, but freegeoip does not read the x-Real-IP location ^~ /freegeoip/ { proxy_pass http://freegeoip.net/json/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; } Then, I'm

How to add a response header on nginx when using proxy_pass?

风格不统一 提交于 2019-12-17 21:41:06
问题 I want to add a custom header for the response received from the server behind nginx. While add_header works for nginx-processed responses, it does nothing when the proxy_pass is used. 回答1: There is a module called HttpHeadersMoreModule that gives you more control over headers. It does not come with Nginx and requires additional installation. With it, you can do something like this: location ... { more_set_headers "Server: my_server"; } That will "set the Server output header to the custom

Conditional ProxyPass Apache

谁都会走 提交于 2019-12-11 18:54:03
问题 I'm trying to achieve a conditional proxypass directive, so when a certain query string is being called to the virtualhost it proxies it somewhere else and adds Header. However ProxyPass is not allowed within the if directive. I was trying this: VirtualHost <*:443> ServerName "${APACHE_HOSTNAME}" <If "%{QUERY_STRING} =~ /some_string/"> RequestHeader set "some_string" "some_string" Header set "some_string" "some_string" ProxyPass / https://<domain>/ ProxyPassReverse / https://<domain>/ </If> <

apache rewrite with proxypass

匆匆过客 提交于 2019-12-11 14:10:34
问题 I am trying to combine a rewrite and a proxy pass and having issues with the rewrite. Here is what I have RewriteEngine On RewriteCond %{HTTP_HOST} ^example.world.net RewriteRule %{HTTP_HOST} http://newexample.newworld.net:7802/apex/f?p=208 [R,P] ProxyPass / http://newexample.newworld.net:7802/ The proxypass is working, but I can't figure out how to get the initial redirect. So if the user puts in example.world.net/apex/f?p=208 it goes to newexample.newworld.net:7802/apex/f?p=208 and masks

Hosting a django project behind proxypass

蹲街弑〆低调 提交于 2019-12-11 01:24:29
问题 I have hosted to django admin project on a local machine X. http://10.4.x.y/myapp/admin works. I have an external IP on another machine Y and i am doing a proxy pass from the Y to X. http://proxypassname.com/myapp/admin works. But, When i click the link "Save" or "Save continue editing" button after editing in admin page, it redirects to local machine ip (i.e. http://10.4.x.y/myapp/blah_blah_blah ). How to make sure that the django project redirects to proxypass name instead of local IP? 回答1:

nginx proxy_pass omitting path

徘徊边缘 提交于 2019-12-10 22:41:30
问题 I have configured a nginx reverse proxy: location / { root /var/www/html; index index.html; } location /login { proxy_pass http://127.0.0.1:9080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location /app { rewrite ^/app/(.*)$ /$1 break; proxy_pass https://10.11.12.13/1020/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } The server listening on port 9080 redirects to the route /app/{generated subpath}. The server on IP 10.11.12.13 processes

How configure nginx for rails app as subdomain?

情到浓时终转凉″ 提交于 2019-12-10 12:25:49
问题 I developed rails app and it's working on domain mpm.head-system.com On my VPS the app is located in /home/mobile_market path . This is nginx.conf: user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 1024; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; server_tokens off; server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream;

“Request Header Or Cookie Too Large” in nginx with proxy_pass

孤街浪徒 提交于 2019-12-10 11:39:27
问题 I have a following nginx setup on my server A (internet facing, only relevant parts): upstream new_api { server unix:///home/ubuntu/new_api/shared/tmp/sockets/puma.sock; } server { listen 80 default_server; listen [::]:80 default_server; large_client_header_buffers 4 16k; ssl_certificate /etc/nginx/cert.crt; ssl_certificate_key /etc/nginx/cert.key; location ~ (^(/some/location|/some/other)) { proxy_pass http://new_api; } location / { proxy_pass https://serverB.com; } } Now, if I go to /some

ProxyPass and ProxyPassReverse for Django app

心已入冬 提交于 2019-12-10 09:45:48
问题 I have a follow up question from my original Django serving question which was how to develop Django apps and serve them from the same server as my main PHP-based site (all part of a larger migration of my website from a static and PHP driven one to a series of Django apps). I couldn't quite use the name server solution I was provided with, and instead just deployed my Django applications on a different port (8000) using mod_wsgi. Now, however, I need to actually integrate the Django