我已经设置httpredirect到https在我启用的网站cloud.conf所以最近我启用站点000-default使用sudo a2ensite 000-default现在这启用了我的000-default站点,它打开预期的文档根没有httpredirect到https因为我没有任何在000默认。 但后来当我启用了网站云端sudo a2ensite cloud它确实启用了我的https网站,打开预期的网站云,但是如果我打开http站点,它既不会自动redirect到https,也可以在http模式下打开000默认网站。 首先,当我启用网站云为什么它仍然在http模式下打开旧网站,而不是redirect? UPDATE $ apachectl -S AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message VirtualHost configuration: *:80 is a NameVirtualHost default server 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1) port 80 namevhost 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1) port 80 namevhost 192.168.1.3 (/etc/apache2/sites-enabled/cloud.conf:1) *:443 […]
我有几个域名,我想redirect到https://indi-ticket.fr 我configuration了Nginx, http ://other-domain.xx中的所有请求都被redirect到了htpps://indi-ticket.fr,但不是来自https ://other-domain.xx的这些请求。 这是我的Nginx conf的相关部分: server { listen 80; server_name www.indi-ticket.fr indi-ticket.fr www.indi-tickets.fr indi-tickets.fr www.indi-ticket.com indi-ticket.com; return 301 https://indi-ticket.fr$request_uri; } server { listen 443 ssl; server_name indi-ticket.fr; ssl on; … 这个conf有什么问题? 什么curl -I -L https://indi-tickets.fr不redirect到https://indi-ticket.fr ?
我有一堆IIS后面的Apache服务器,每个服务器有一个站点运行,子域从IISredirect到Apache是正常工作与URL重写+ ARR,如下所示: —– a.company.com >> |IIS| >> apache_server_a (10.0.0.1) —– —– b.company.com >> |IIS| >> apache_server_b (10.0.0.2) —– —– c.company.com >> |IIS| >> apache_server_b (10.0.0.3) —– 但我的一个apaches有5个客户站点,他使用虚拟主机。 我怎样才能redirectIIS收到这五个网站的请求到Apache而不更改URL? client1.com —– client2.com >> |IIS| >> apache_with_virtual_hosts (10.0.0.4) client3.com —– client4.com client5.com OBS:。 IIS不会停留在与Apache服务器相同的机器上
我已经添加了一个SSL证书到我的网站,我有一个像这样的configuration文件: server { listen 80; listen [::]:80; server_name www.default.com default.com; return 301 https://default.com$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; server_name default.com; … } 我有几个客户端在服务器的IP地址上查看中转站点,所以我会让他们看一下http://123.123.123.123 现在IP地址已经与几百人共享,并且SSL添加已经打破了IP地址的链接,我想将其redirect到域名。 我将redirect添加到顶部的块,还是创build第三个块? 例如: server { listen 80; listen [::]:80; server_name www.default.com default.com; return 301 https://default.com$request_uri; } server { listen 80; listen 123.123.123.123:80; server_name 123.123.123.123; return 301 https://default.com$request_uri; } […]
通过htaccess文件我试图redirect/services /services/onetime但它redirect到/services/onetime/onetime/onetime/… 代码有什么问题,有没有办法做到这一点? 这是我用过的代码: redirect 301 /services/ /services/onetime/
我在<VirtualHost *:80>有以下redirect: RewriteRule ^/old-url$ /new-url [R=301,L] RewriteRule ^/foo$ /bar [R=301,L] … 在apache之前,我有haproxy,在80和443上进行监听,后者进行SSL终止,并且: http-request set-header X-Forwarded-Port %[dst_port] http-request set-header X-Forwarded-Proto https if { ssl_fc } 我对redirect的问题是: http://example.com/foo正确地redirect到http://example.com/bar https://example.com/foo错误地redirect到http://example.com/bar 我怎样才能确保httpredirect到http和https到https ? 请注意,我想避免不得不重写两次redirect规则。 我如何使用X-Forwarded-Proto或X-Forwarded-Portredirect到正确的scheme?
在早些时候问了一个冗长而复杂的问题之后,我现在使用了RedirectPermanent一些代码,我需要帮助。 我们正在合并一个旧的网站到新的一个,并不关心映射所有的古代url到新址的任何地方,所以它应该永久redirect到一个特殊的index.php将决定是否/在哪里redirect与PHP。 例外是一个子域,它应该做同样的事情,但不同的index.php。 这是我试图完成的“伪configuration” – 轻微的变化将工作,但我不能让它忽略请求的完整path,并无条件地去我的select与查询string的index.php。 #Subdomain from old site: #Process querystring from root\oldsite\subdomain\index.php <VirtualHost *:80> ServerName subdomain.oldsite.com RedirectPermanent / http://www.newsite.com/oldsite/subdomain/index.php </VirtualHost> #ALL other requests of any kind regardless of path #Process querystring from root\oldsite\index.php # Must show www.newsite.com, NOT www.oldsite.com <VirtualHost *:80> ServerName oldsite.com ServerAlias www.oldsite.com RedirectPermanent / http://www.newsite.com/oldsite/index.php </VirtualHost> 已经设置了DNS,以便从旧站点的所有内容都进入该服务器,这些是configuration文件中的第一个VirtualHost条目。 我如何修改这个代码去给定的index.php, 不pipepath。 www.oldsite.com […]
在Apache中进行以下工作时遇到了一些困难: 我们有一个坐在AWS ELB后面的apache / tomcat实例。 ELB正在做SSL终止,所以我们在服务器上有一个redirect来处理这个问题。 我需要/health可以通过HTTP ELB健康检查工作。 我需要将所有不是/ theme东西发送到tomcat ie /foo代理到localhost:8080/foo 。 我已经尝试了使用mod_proxy和/或mod_rewrite下面的configuration的一些变化,但我似乎无法得到这个工作正常,所以将不胜感激任何指针。 <Location /health> ProxyPass http://localhost:8080/health ttl=1 ProxyPassReverse http://localhost:8080/health </Location> <Location ~ "^/(.+)"> RewriteEngine On RewriteCond %{HTTP:X-Forwarded-Proto} =https RewriteCond %{REQUEST_URI} !^/(health|theme)/ RewriteRule . http://localhost:8080/$1 [P] ProxyPassReverse http://localhost:8080/$1 </Location> <Location /> RewriteEngine On RewriteCond %{REQUEST_URI} !^/health RewriteCond %{HTTP:X-Forwarded-Proto} =http RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent] </Location> […]
我有多个节点的websockets可以通过匹配的UNIX套接字path的URL。 而不是重复的位置指令,我想有一个像Url列表将被用作套接字名称。 使用正则expression式不起作用,因为我需要套接字名称的path。 目前我正在使用这个位置: location /application1/ { proxy_pass http://unix:/var/run/nodejs/application1; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } 目标是有这样的东西: $list = [app1, app2, app3]; #list of possible names location /$list/ #match all names in the list { proxy_pass http://unix:/var/run/nodejs/$list_matched; #use matched name proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } 基本上,列表中的每个URL都应redirect到具有相同名称的套接字。 在此先感谢您的帮助:)
我正在运行一个Nginx服务器,通过SSL为我的网站提供服务。 对于SSL支持,我使用LetsEncrypte。 sites-available Nginxconfiguration文件sites-available如下所示: server { listen 80; server_name domain.nl anotherdomain.nl; # return 301 https://$server_name$request_uri; return 301 https://domain.nl$request_uri; } server { listen 80; server_name www.domain.nl; return 301 $scheme://domain.nl$request_uri; } server { listen 443; server_name domain.nl; # SSL ssl_certificate /etc/letsencrypt/live/domain.nl/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/domain.nl/privkey.pem; include snippets/ssl-params.conf; location / { proxy_pass http://localhost:6000; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header […]