Nginx serving wrong website using subdomainHelp needed setting up nginx to serve static filesHow to make nginx reverse proxy let 503 error pages pass through to client?Blank Page: wordpress on nginx+php-fpmNginx proxy pass works for https but not httpNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breakHow to serve Autodiscover.xml using NginxConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsNginx reverse proxy to many local servers + webserver duty

Multi tool use
Multi tool use

If Earth is tilted, why is Polaris always above the same spot?

Phrase for the opposite of "foolproof"

How deep to place a deadman anchor for a slackline?

Confused by notation of atomic number Z and mass number A on periodic table of elements

Is it cheaper to drop cargo drop than to land it?

Packing rectangles: Does rotation ever help?

Is it possible to Ready a spell to be cast just before the start of your next turn by having the trigger be an ally's attack?

Unexpected email from Yorkshire Bank

Is GOCE a satellite or aircraft?

In gnome-terminal only 2 out of 3 zoom keys work

Will tsunami waves travel forever if there was no land?

How to back up a running remote server?

How to stop co-workers from teasing me because I know Russian?

What's the polite way to say "I need to urinate"?

How to replace the "space symbol" (squat-u) in listings?

Build a trail cart

Airbnb - host wants to reduce rooms, can we get refund?

How does a Swashbuckler rogue "fight with two weapons while safely darting away"?

Please, smoke with good manners

Can a creature tell when it has been affected by a Divination wizard's Portent?

Python "triplet" dictionary?

Help, my Death Star suffers from Kessler syndrome!

Does a creature that is immune to a condition still make a saving throw?

Is it possible to measure lightning discharges as Nikola Tesla?



Nginx serving wrong website using subdomain


Help needed setting up nginx to serve static filesHow to make nginx reverse proxy let 503 error pages pass through to client?Blank Page: wordpress on nginx+php-fpmNginx proxy pass works for https but not httpNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breakHow to serve Autodiscover.xml using NginxConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsNginx reverse proxy to many local servers + webserver duty






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















New to all this so please bear with me. I have one existing website set up using nginx (fusiondiscordbots.com) however, I am wanting to add a second on the subdomain - dashboard.application-bot.com. The main domain is set to a GitHub.io site meanwhile the A records of the subdomain are pointed to the ip of my nginx hosting VPS. When I try to connect to the subdomain, I get served with my other site (fusiondiscordbots.com). I was wondering if anyone could help, I have coped all my config files below. Thank, Sean.



Nginx Config



server 
server_name www.dashboard.application-bot.com;
return 301 https://dashboard.application-bot.com$request_uri;


server
listen 80;

server_name dashboard.application-bot.com;
location /
return 301 https://dashboard.application-bot.com$request_uri;



server
listen 443 ssl;
server_name dashboard.application-bot.com;

ssl_certificate /etc/letsencrypt/live/dashboard.application-bot.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dashboard.application-bot.com/privkey.pem;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location /
proxy_pass https://localhost:8004;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


location /static
alias /var/www/application-web/app/static;
expires 30d;





Other nginx config file for fusiondiscordbots.com



server 
server_name www.fusiondiscordbots.com;
return 301 https://fusiondiscordbots.com$request_uri;


server
listen 80;

server_name fusiondiscordbots.com;
location /
return 301 https://$host$request_uri;



server
listen 443 ssl;
server_name fusiondiscordbots.com;

ssl_certificate /etc/letsencrypt/live/fusiondiscordbots.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/fusiondiscordbots.com/privkey.pem;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location /
proxy_pass https://localhost:8001;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


location /static
alias /var/www/fusion-web/app/static;
expires 30d;


location /sitemap.xml
alias /var/www/fusion-web/app/static/sitemap.xml;
expires 30d;


location /robot.txt
alias /var/www/fusion-web/app/static/robot.txt;
expires 30d;


location /.well-known
alias /var/www/fusion-web/app/static/;
expires 30d;





Any idea would be appreciated and if any more info is require, please ask. Thanks again.










share|improve this question






















  • what happens if you try with a different browser? 301 redirects are "permanent" and cached by the browser

    – ignivs
    Apr 21 at 19:18






  • 2





    I think you haven't started nginx with this configuration. Restart it.

    – Michael Hampton
    Apr 21 at 19:21











  • I have restarted it and tried it again in Firefox (which I have just downloaded), it still serves up the fusion website.

    – Sean Hatch
    Apr 21 at 21:34











  • If your OS is Debian / Ubuntu Linux, you might have missed to setup the symbolic link from /etc/nginx/sites-available to /etc/nginx/sites-enabled.

    – Tero Kilkanen
    Apr 21 at 22:21











  • Turns out I forgot to add it to the main nginx config file using include /etc/nginx/sites-enabled/applicationweb; . That fixed the problem. Thanks for your ideas anyway.

    – Sean Hatch
    Apr 22 at 9:32


















0















New to all this so please bear with me. I have one existing website set up using nginx (fusiondiscordbots.com) however, I am wanting to add a second on the subdomain - dashboard.application-bot.com. The main domain is set to a GitHub.io site meanwhile the A records of the subdomain are pointed to the ip of my nginx hosting VPS. When I try to connect to the subdomain, I get served with my other site (fusiondiscordbots.com). I was wondering if anyone could help, I have coped all my config files below. Thank, Sean.



Nginx Config



server 
server_name www.dashboard.application-bot.com;
return 301 https://dashboard.application-bot.com$request_uri;


server
listen 80;

server_name dashboard.application-bot.com;
location /
return 301 https://dashboard.application-bot.com$request_uri;



server
listen 443 ssl;
server_name dashboard.application-bot.com;

ssl_certificate /etc/letsencrypt/live/dashboard.application-bot.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dashboard.application-bot.com/privkey.pem;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location /
proxy_pass https://localhost:8004;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


location /static
alias /var/www/application-web/app/static;
expires 30d;





Other nginx config file for fusiondiscordbots.com



server 
server_name www.fusiondiscordbots.com;
return 301 https://fusiondiscordbots.com$request_uri;


server
listen 80;

server_name fusiondiscordbots.com;
location /
return 301 https://$host$request_uri;



server
listen 443 ssl;
server_name fusiondiscordbots.com;

ssl_certificate /etc/letsencrypt/live/fusiondiscordbots.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/fusiondiscordbots.com/privkey.pem;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location /
proxy_pass https://localhost:8001;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


location /static
alias /var/www/fusion-web/app/static;
expires 30d;


location /sitemap.xml
alias /var/www/fusion-web/app/static/sitemap.xml;
expires 30d;


location /robot.txt
alias /var/www/fusion-web/app/static/robot.txt;
expires 30d;


location /.well-known
alias /var/www/fusion-web/app/static/;
expires 30d;





Any idea would be appreciated and if any more info is require, please ask. Thanks again.










share|improve this question






















  • what happens if you try with a different browser? 301 redirects are "permanent" and cached by the browser

    – ignivs
    Apr 21 at 19:18






  • 2





    I think you haven't started nginx with this configuration. Restart it.

    – Michael Hampton
    Apr 21 at 19:21











  • I have restarted it and tried it again in Firefox (which I have just downloaded), it still serves up the fusion website.

    – Sean Hatch
    Apr 21 at 21:34











  • If your OS is Debian / Ubuntu Linux, you might have missed to setup the symbolic link from /etc/nginx/sites-available to /etc/nginx/sites-enabled.

    – Tero Kilkanen
    Apr 21 at 22:21











  • Turns out I forgot to add it to the main nginx config file using include /etc/nginx/sites-enabled/applicationweb; . That fixed the problem. Thanks for your ideas anyway.

    – Sean Hatch
    Apr 22 at 9:32














0












0








0








New to all this so please bear with me. I have one existing website set up using nginx (fusiondiscordbots.com) however, I am wanting to add a second on the subdomain - dashboard.application-bot.com. The main domain is set to a GitHub.io site meanwhile the A records of the subdomain are pointed to the ip of my nginx hosting VPS. When I try to connect to the subdomain, I get served with my other site (fusiondiscordbots.com). I was wondering if anyone could help, I have coped all my config files below. Thank, Sean.



Nginx Config



server 
server_name www.dashboard.application-bot.com;
return 301 https://dashboard.application-bot.com$request_uri;


server
listen 80;

server_name dashboard.application-bot.com;
location /
return 301 https://dashboard.application-bot.com$request_uri;



server
listen 443 ssl;
server_name dashboard.application-bot.com;

ssl_certificate /etc/letsencrypt/live/dashboard.application-bot.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dashboard.application-bot.com/privkey.pem;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location /
proxy_pass https://localhost:8004;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


location /static
alias /var/www/application-web/app/static;
expires 30d;





Other nginx config file for fusiondiscordbots.com



server 
server_name www.fusiondiscordbots.com;
return 301 https://fusiondiscordbots.com$request_uri;


server
listen 80;

server_name fusiondiscordbots.com;
location /
return 301 https://$host$request_uri;



server
listen 443 ssl;
server_name fusiondiscordbots.com;

ssl_certificate /etc/letsencrypt/live/fusiondiscordbots.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/fusiondiscordbots.com/privkey.pem;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location /
proxy_pass https://localhost:8001;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


location /static
alias /var/www/fusion-web/app/static;
expires 30d;


location /sitemap.xml
alias /var/www/fusion-web/app/static/sitemap.xml;
expires 30d;


location /robot.txt
alias /var/www/fusion-web/app/static/robot.txt;
expires 30d;


location /.well-known
alias /var/www/fusion-web/app/static/;
expires 30d;





Any idea would be appreciated and if any more info is require, please ask. Thanks again.










share|improve this question














New to all this so please bear with me. I have one existing website set up using nginx (fusiondiscordbots.com) however, I am wanting to add a second on the subdomain - dashboard.application-bot.com. The main domain is set to a GitHub.io site meanwhile the A records of the subdomain are pointed to the ip of my nginx hosting VPS. When I try to connect to the subdomain, I get served with my other site (fusiondiscordbots.com). I was wondering if anyone could help, I have coped all my config files below. Thank, Sean.



Nginx Config



server 
server_name www.dashboard.application-bot.com;
return 301 https://dashboard.application-bot.com$request_uri;


server
listen 80;

server_name dashboard.application-bot.com;
location /
return 301 https://dashboard.application-bot.com$request_uri;



server
listen 443 ssl;
server_name dashboard.application-bot.com;

ssl_certificate /etc/letsencrypt/live/dashboard.application-bot.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/dashboard.application-bot.com/privkey.pem;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location /
proxy_pass https://localhost:8004;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


location /static
alias /var/www/application-web/app/static;
expires 30d;





Other nginx config file for fusiondiscordbots.com



server 
server_name www.fusiondiscordbots.com;
return 301 https://fusiondiscordbots.com$request_uri;


server
listen 80;

server_name fusiondiscordbots.com;
location /
return 301 https://$host$request_uri;



server
listen 443 ssl;
server_name fusiondiscordbots.com;

ssl_certificate /etc/letsencrypt/live/fusiondiscordbots.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/fusiondiscordbots.com/privkey.pem;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location /
proxy_pass https://localhost:8001;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


location /static
alias /var/www/fusion-web/app/static;
expires 30d;


location /sitemap.xml
alias /var/www/fusion-web/app/static/sitemap.xml;
expires 30d;


location /robot.txt
alias /var/www/fusion-web/app/static/robot.txt;
expires 30d;


location /.well-known
alias /var/www/fusion-web/app/static/;
expires 30d;





Any idea would be appreciated and if any more info is require, please ask. Thanks again.







nginx subdomain






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 21 at 18:57









Sean HatchSean Hatch

1




1












  • what happens if you try with a different browser? 301 redirects are "permanent" and cached by the browser

    – ignivs
    Apr 21 at 19:18






  • 2





    I think you haven't started nginx with this configuration. Restart it.

    – Michael Hampton
    Apr 21 at 19:21











  • I have restarted it and tried it again in Firefox (which I have just downloaded), it still serves up the fusion website.

    – Sean Hatch
    Apr 21 at 21:34











  • If your OS is Debian / Ubuntu Linux, you might have missed to setup the symbolic link from /etc/nginx/sites-available to /etc/nginx/sites-enabled.

    – Tero Kilkanen
    Apr 21 at 22:21











  • Turns out I forgot to add it to the main nginx config file using include /etc/nginx/sites-enabled/applicationweb; . That fixed the problem. Thanks for your ideas anyway.

    – Sean Hatch
    Apr 22 at 9:32


















  • what happens if you try with a different browser? 301 redirects are "permanent" and cached by the browser

    – ignivs
    Apr 21 at 19:18






  • 2





    I think you haven't started nginx with this configuration. Restart it.

    – Michael Hampton
    Apr 21 at 19:21











  • I have restarted it and tried it again in Firefox (which I have just downloaded), it still serves up the fusion website.

    – Sean Hatch
    Apr 21 at 21:34











  • If your OS is Debian / Ubuntu Linux, you might have missed to setup the symbolic link from /etc/nginx/sites-available to /etc/nginx/sites-enabled.

    – Tero Kilkanen
    Apr 21 at 22:21











  • Turns out I forgot to add it to the main nginx config file using include /etc/nginx/sites-enabled/applicationweb; . That fixed the problem. Thanks for your ideas anyway.

    – Sean Hatch
    Apr 22 at 9:32

















what happens if you try with a different browser? 301 redirects are "permanent" and cached by the browser

– ignivs
Apr 21 at 19:18





what happens if you try with a different browser? 301 redirects are "permanent" and cached by the browser

– ignivs
Apr 21 at 19:18




2




2





I think you haven't started nginx with this configuration. Restart it.

– Michael Hampton
Apr 21 at 19:21





I think you haven't started nginx with this configuration. Restart it.

– Michael Hampton
Apr 21 at 19:21













I have restarted it and tried it again in Firefox (which I have just downloaded), it still serves up the fusion website.

– Sean Hatch
Apr 21 at 21:34





I have restarted it and tried it again in Firefox (which I have just downloaded), it still serves up the fusion website.

– Sean Hatch
Apr 21 at 21:34













If your OS is Debian / Ubuntu Linux, you might have missed to setup the symbolic link from /etc/nginx/sites-available to /etc/nginx/sites-enabled.

– Tero Kilkanen
Apr 21 at 22:21





If your OS is Debian / Ubuntu Linux, you might have missed to setup the symbolic link from /etc/nginx/sites-available to /etc/nginx/sites-enabled.

– Tero Kilkanen
Apr 21 at 22:21













Turns out I forgot to add it to the main nginx config file using include /etc/nginx/sites-enabled/applicationweb; . That fixed the problem. Thanks for your ideas anyway.

– Sean Hatch
Apr 22 at 9:32






Turns out I forgot to add it to the main nginx config file using include /etc/nginx/sites-enabled/applicationweb; . That fixed the problem. Thanks for your ideas anyway.

– Sean Hatch
Apr 22 at 9:32











0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f963990%2fnginx-serving-wrong-website-using-subdomain%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Server Fault!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f963990%2fnginx-serving-wrong-website-using-subdomain%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







4YSV5HYcvaC 3cQjo,8,nQ5dD9,RPB7fA94n,BCgrgW,m,0Dvp86
XBHxwLl3qtj61tGFmxev a7iW2aq

Popular posts from this blog

RemoteApp sporadic failureWindows 2008 RemoteAPP client disconnects within a matter of minutesWhat is the minimum version of RDP supported by Server 2012 RDS?How to configure a Remoteapp server to increase stabilityMicrosoft RemoteApp Active SessionRDWeb TS connection broken for some users post RemoteApp certificate changeRemote Desktop Licensing, RemoteAPPRDS 2012 R2 some users are not able to logon after changed date and time on Connection BrokersWhat happens during Remote Desktop logon, and is there any logging?After installing RDS on WinServer 2016 I still can only connect with two users?RD Connection via RDGW to Session host is not connecting

Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020