我在configurationVarnish时遇到了一些麻烦,在线文档不是很清楚(至less对我来说)。 我目前有一个Ubuntu服务器上的清漆caching设置。 我在同一台服务器上testing了本地Nginx的清漆,并且工作正常。 我想要做的就是使用Varnish作为configuration了Nginx的远程Web服务器的caching和反向代理。 我需要保留客户端请求的主机名,并将其传递给远程的Nginx Web服务器。 这可以在Nginx使用proxy_set_header主机和Apache通过使用ProxyPreserveHost在。 问题是我在我的远程Nginx上有许多不同的虚拟主机,服务器的DNS没有configuration其中的任何一个。 他们都是不同的,所以我需要确保从客户端请求的主机通过。 我很抱歉,如果这不清楚,但我是光油的全新,这是什么,就像我习惯与Apache或Nginx。 任何帮助将不胜感激。 这是我的default.vcl: vcl 4.0; # Default backend definition. Set this to point to your content server. backend default { .host = "dns.of.remote.nginx.server"; .port = "80"; .probe = { .url = "/"; .timeout = 30s; .threshold = 8; } } sub vcl_recv { # Happens before […]
我目前有一对docker容器在一个节点上运行,其中两个是Apache Web服务器,我configuration了一个反向代理和Portainer,允许我通过GUIpipe理我的容器。 我已经尝试跟随这个线程: https : //github.com/portainer/portainer/issues/488,但已经无法将stream量从Apache转发到Portainer。 这是我的httpd.conf文件: <Location /portainer/> AuthBasicProvider ldap AuthLDAPURL someldap AuthType Basic AuthName SomeAuthName require valid-user </Location> ProxyPass /portainer/api/websocket/ ws://172.18.0.8:9000/api/websocket/ </VirtualHost> 有任何想法吗? 谢谢!
我希望以/api开始的所有内容都被定向到http://localhost:3007 这是我的nginx.conf user nginx; worker_processes 1; daemon off; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; location / { root /usr/html; index index.html index.htm; } location /api { proxy_pass http://localhost:3007; proxy_read_timeout 5m; } error_page 500 502 503 504 /50x.html; location = /50x.html […]
我正在尝试在http://example.com/supervisor上提供supervisord网页界面 尝试了好几个小时后,我用正斜杠( http://example.com/supervisor/ )正确工作。 我得到它显示没有太斜杠,但没有图像/ CSS等的作品。 我是nginx的新手,所以我猜我的重写规则有些问题。 第一次重写是我试图添加一个结尾的斜杠。 supervisord.conf [unix_http_server] file = /tmp/supervisor.sock ; (the path to the socket file) chmod=0700 ; socket file mode (default 0700) nginx.conf location ~* ^/supervisor/? { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_x_host; proxy_set_header X-NginX-Proxy true; rewrite ^(.*[^/])$ $1/; rewrite /supervisor/(.*) /$1 break; proxy_pass http://unix:/tmp/supervisor.sock:; proxy_redirect off; […]
所以我似乎有一个看似简单的问题,但我对此很新。 我已经为我的开发环境设置了一个反向代理,而且我有几台运行不同应用程序的机器,所以我明确地在不同端口的本地主机上运行它们。 每当我打到一个位置说localhost/location1和localhost/location2它做一个proxy_pass localhost:8000和localhost:4343 。 但是,当我在浏览器中查看下面的根位置时,url将更改为proxy_pass https://develop.example.com/;的实际URL proxy_pass https://develop.example.com/; 而不是只说本地主机,我期望它像所有其他人一样做。 那么为什么这会改变url? 我甚至尝试做一个代理传递到谷歌,如预期的那样工作,只是说本地主机,但显示谷歌404页面。 任何见解和或如何我可以去debugging这个build议,将不胜感激。 location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-URI $request_uri; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Published-On https://develop.example.com/; proxy_pass https://develop.example.com/; #proxy_pass http://www.google.com/; index index.php; }
我有一个IIS服务器(在WinServer 2016上),它充当几个Kestrel Web服务器的反向代理。 现在我正在尝试设置IIS来转发所有的X-Forwarded- *标头。 对于X-Forwarded-For和X-Forwarded-Proto头文件,一切正常,但不适用于X-Forwarded-Host。 这是服务器级别的“允许的服务器variables”: 这是我在debugging器中看到的,当HTTP请求命中Kestrelnetworking服务器 不幸的是我不能从PROD服务器创build转储,但是由于一些function不能正常工作,所以情况应该与DEV环境类似。 在阅读了关于如何将IIS设置为反向代理的一些文章之后,我得到了一个所有的X-Forwarded- *头文件应该被自动添加的印象。 或者,XFH是一个例外,我需要手动设置它? 我将非常感激任何forms的帮助!
怎么可能有一个通配符目录代理? 我已经得到了基本的,但问题是,它给出了我的目录,我的htaccess文件: RewriteEngine on RewriteCond %{REQUEST_URI} !(u|api|fonts|images|css|js) [NC] # No directory RewriteRule ^(.*)\.(jpg|gif|png|txt|mp4|mp3|json|js|zip|bmp|tiff|webp|webm|raw|psd|jpeg|jpe|wav)(.*) http://127.0.0.1:9000/owoapi/$1.$2$3?%{QUERY_STRING} [proxy] # One Directory RewriteRule ^([^/]+)/(.*)\. (jpg|gif|png|txt|mp4|mp3|json|js|zip|bmp|tiff|webp|webm|raw|psd|jpeg|jpe|wav) (.*) http://127.0.0.1:9000/owoapi/$1.$2$3?%{QUERY_STRING} [proxy] 当访问domain.tld/image.png ,它工作得很好。 当访问domain.tld/test/image.png ,404代码是由于它包含/ test /在代理URL中,我该如何解决这个问题呢? 编辑:我试图实现的是不包括前面的URL,并使其行为像它被访问通过domain.tld/image.png而不是domain.tld/test/image.png
我们有一个Ubuntu服务器上的Apache反向代理设置。 服务器应该通过反向代理将用户redirect到其他服务器并存储cookie。 带有Apache的服务器还运行着一个Wordpress安装程序。 我们已经设置好了,除了URL部分和cookies存在缺陷之外,它工作正常。 例: 当我们点击下面的urlhttps://subdomain.mywebsite.com/?a_aid=137355&brandid=509821&languageCode=EN&mobile=0 它redirect到 https://otherwebsiteintheproxyserver.com/?languageCode=EN&mobile=0 而且据我所知,它不存储任何cookies。 <IfModule mod_ssl.c> <VirtualHost subdomain.mywebsite.com:443> ProxyPreserveHost On RequestHeader set Front-End-Https "On" ServerName subdomain.mywebsite.com SSLProxyEngine on ProxyPass / http://someother.domain.com/ ProxyPassReverse / http://someother.domain.com/ ProxyPassReverseCookieDomain https://subdomain.mywebsite.com http://someother.domain.com/ SSLCertificateFile /etc/letsencrypt/live/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateChainFile /etc/letsencrypt/live/chain.pem </VirtualHost> </IfModule>
我昨天了解了Nginx,为了更加准确,我第一次了解了以下url上的所有主题: 初始服务器设置与Ubuntu 16.04 如何在ubuntu 16.04上安装和保护mongodb 如何在Ubuntu 16.04上添加交换空间 如何在Ubuntu上备份还原和迁移MongoDB数据库 如何在ubuntu 16.04上安装Nginx 如何保护nginx与我们的encryption在Ubuntu 16.04 如何在Ubuntu 16.04上安装节点js 如何在ubuntu 16.04上设置节点js应用程序进行生产 但我仍然在这里卡住, 我在哪里 我正在编辑这个Nginxconfiguration文件: /etc/nginx/sites-available/default server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; server_name mysite.mydomain.com; ssl_dhparam /etc/ssl/certs/dhparam.pem; location / { proxy_pass http://localhost:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } listen 443 […]
我以http://host.example/foo/或http://host.example/foo//的格式收到请求。请求通过proxy_pass http://backend;发送到后端服务器proxy_pass http://backend; 并使用密钥proxy_cache_key "$scheme://$host$uri$is_args$args" 。然后,后端决定应该用多个斜杠进行操作。 但是,如果/ foo //redirect到/ foo /,则使用与/ foo /相同的caching键保存该条目,从而导致redirect循环。 现在我当然有了merge_slashes on; 我想保留,因为有几个位置匹配,没有它会变得复杂。 有没有像$unmerged_uri proxy_cache_key这样的proxy_pass和proxy_cache_key会匹配?