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

How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?