2

I am working with NGINX and I have a couple issues here.

I have a domain and one subdomain

Server block for domain

listen       80;
server_name  just4bettors.mobi  www.just4bettors.mobi;
root   /home/c0pt/capilleira/capilleiraclickandgamblemobile/www

Server block for subdomain

listen 80;
server_name www.desktop.just4bettors.mobi desktop.just4bettors.mobi;
root   /home/c0pt/capilleira/capilleiraclickandgambleweb/dist;

for the domain everything works properly, you can access to the page and log and there is nothing wrong, but once you try to enter to the subdomain, you can see an error on the screen Server not found when you enter http://www.desktop.just4bettors.mobi, and when you enter http://desktop.just4bettors.mobi you get GET http://desktop.just4bettors.mobi/ net::ERR_NAME_NOT_RESOLVED

Content-Security-Policy for domain

add_header Content-Security-Policy
  "default-src 'self';
  script-src 'self' 'unsafe-inline' 'unsafe-eval';
  style-src 'self' 'unsafe-inline' https://fonts.googleapis.com  https://themes.googleusercontent.com https://fonts.gstatic.com https://assets.zendesk.com;
  object-src 'none';
  connect-src http://just4bettors.mobi http://just4bettors.mobi:1337 http://www.just4bettors.mobi;";

now these are the Content-Security-Policy for the sub-domain

add_header Content-Security-Policy
  "default-src 'self';
  script-src 'self' 'unsafe-inline' 'unsafe-eval' http://www.just4bettors.mobi http://www.desktop.just4bettors.mobi;
  style-src 'self' 'unsafe-inline'
  object-src 'none';
  connect-src http://desktop.just4bettors.mobi http://www.desktop.just4bettors.mobi;";

so, what am I missing ? basically, the question would be: why I can not access to the subdomain ?

PD: all the DNS part is done already.

4

You said that: "all the DNS part is done already." In fact, all the DNS part is not done already. We can clearly see:

$ host just4bettors.mobi
just4bettors.mobi has address 190.171.28.156
$ host www.just4bettors.mobi
www.just4bettors.mobi has address 190.171.28.156
$ host desktop.just4bettors.mobi
Host desktop.just4bettors.mobi not found: 3(NXDOMAIN)
$ host www.desktop.just4bettors.mobi
Host www.desktop.just4bettors.mobi not found: 3(NXDOMAIN)

You just need to set up your DNS records correctly.

6
  • Do I configure those records in the DNS or in the NGINX part?
    – Reacting
    Mar 30 '15 at 19:41
  • As I already said, it's DNS! Mar 30 '15 at 19:44
  • Sorry, I am the one in charge in configure all the NGINX part/files, but if there is any issue with the DNS part, so I will have to talk to my co-workers. So, the changes I need to apply, are in the DNS ? thanks in advance.
    – Reacting
    Mar 30 '15 at 19:46
  • For the third time yes! Go have your co-workers fix your DNS. Mar 30 '15 at 19:47
  • 1
    These are standard UNIX commands for querying DNS records. You should really learn the basics of DNS before working on web services. Mar 30 '15 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.