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

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







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

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