I have two sub-domains which I want to link in the following way:
https://suba.example.org/
is my main subdomain, https://subb.example.org/
is my secondary subdomain.
On suba I have a server running a web application, subb is only for redirection.
This server on suba has a url, lets call it https://suba.example.org/foo.php/bar
.
All I want is, that whenever I type https://subb.example.org/
into my browser, the content of https://suba.example.org/foo.php/bar
is shown, but the URL needs to say https://subb.example.org/
.
As of right now, it will correctly show the content of https://suba.example.org/foo.php/bar
but the browser will show the URL of content and not https://subb.example.org/
.
I have restarted the nginx-server several times and used an incognito-window, to be sure, that the browser won't cache any data.
What is happening is:
- I open
https://subb.example.org/
on a Chrome incognito-window on my desktop: it will show the correct output fromhttps://suba.example.org/foo.php/bar
, but showinghttps://suba.example.org/foo.php/bar
in the URL bar - I open
https://subb.example.org/
on any other browser/machine (including a Chrome incognito-window on another machine): it will show the content fromhttps://suba.example.org/foo.php/bar
withhttps://subb.example.org
URL bar, but only the text, no css or picture. Like a 80s website.
Right before clicking enter: https://i.stack.imgur.com/Q5mgx.png
What is happening: https://i.stack.imgur.com/CfHM1.png
What should be happening: https://i.stack.imgur.com/5OxQ4.png
Any help is appreciated.
Attached is my nginx site-config for subb
:
server {
listen 443 ssl;
root /config/www;
index index.html index.htm index.php;
### Server Name
server_name subb.example.org;
### SSL Certificates
ssl_certificate /config/keys/letsencrypt/fullchain.pem;
ssl_certificate_key /config/keys/letsencrypt/privkey.pem;
### Diffie–Hellman key exchange
ssl_dhparam /config/nginx/dhparams.pem;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
### Extra Settings
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
### Add HTTP Strict Transport Security
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header Front-End-Https on;
client_max_body_size 0;
location / {
proxy_pass https://suba.example.org/foo.php/bar;
}
}
Here is the nginx site-config for suba
:
server {
listen 443 ssl;
root /config/www;
index index.html index.htm index.php;
### Server Name
server_name suba.example.org;
### SSL Certificates
ssl_certificate /config/keys/letsencrypt/fullchain.pem;
ssl_certificate_key /config/keys/letsencrypt/privkey.pem;
### Diffie–Hellman key exchange
ssl_dhparam /config/nginx/dhparams.pem;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
### Extra Settings
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
### Add HTTP Strict Transport Security
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header Front-End-Https on;
client_max_body_size 0;
location / {
proxy_pass https://192.168.178.6:444/;
}
}
And here goes the response for curl -i https://subb.example.org
:
HTTP/1.1 200 OK
Server: nginx/1.12.1
Date: Mon, 07 Aug 2017 19:24:03 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 11185
Connection: keep-alive
X-Powered-By: PHP/7.1.5
Set-Cookie: oc367h1rrnkw=i7l0tko9m9unbifqus6lqua1v2; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Set-Cookie: oc_sessionPassphrase=eFmSS9gKBYJ4YP0MHDFhmxnhJZnmWTDAMjN4zkTrEenumTa66yy6SeWCs12oU2k2MbDN424ySgGeyyYbciCK7Fs3gmmjtwAJU3a3r87BXZ1Uk%2FmdLEXuZoFdy4mbPH67; path=/; secure; HttpOnly
X-Frame-Options: SAMEORIGIN
Set-Cookie: __Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax
Set-Cookie: __Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict
Cache-Control: no-cache, no-store, must-revalidate
Content-Security-Policy: default-src 'none';base-uri 'none';manifest-src 'self';script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self';frame-src 'self'
Strict-Transport-Security: max-age=15768000; includeSubDomains; preload;
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Robots-Tag: none
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Strict-Transport-Security: max-age=63072000; includeSubdomains
Front-End-Https: on
Strict-Transport-Security: max-age=63072000; includeSubdomains
Front-End-Https: on
I pasted to output of the Live HTTP Header Plugin to pastbin:
pastebin.com/a6kfqhMn