How do I point my Subdomain to correct root folderPlesk 9: how to create a subdomain pointing to a folder in...

Is HostGator storing my password in plaintext?

Proof of work - lottery approach

Is `x >> pure y` equivalent to `liftM (const y) x`

CREATE opcode: what does it really do?

What is the best translation for "slot" in the context of multiplayer video games?

How do I go from 300 unfinished/half written blog posts, to published posts?

Go Pregnant or Go Home

How do I extract a value from a time formatted value in excel?

What is the intuitive meaning of having a linear relationship between the logs of two variables?

Did the DC-9 ever use RATO in revenue service?

Increase performance creating Mandelbrot set in python

Is expanding the research of a group into machine learning as a PhD student risky?

How do we know the LHC results are robust?

Would this custom Sorcerer variant that can only learn any verbal-component-only spell be unbalanced?

Pre-amplifier input protection

Opposite of a diet

Is this apparent Class Action settlement a spam message?

Avoiding estate tax by giving multiple gifts

Term for the "extreme-extension" version of a straw man fallacy?

Roman Numeral Treatment of Suspensions

Why are there no referendums in the US?

Did Dumbledore lie to Harry about how long he had James Potter's invisibility cloak when he was examining it? If so, why?

What does "I’d sit this one out, Cap," imply or mean in the context?

Is there a good way to store credentials outside of a password manager?



How do I point my Subdomain to correct root folder


Plesk 9: how to create a subdomain pointing to a folder in main web root?How to make nginx reverse proxy let 503 error pages pass through to client?nginx rewrite throw 404 with last and breaknon www to www domain?Link any subdomain to a different path than the www-path in nginx conf-fileTwo domains on one IP, added a subdomain and different domain's SSL gets protocol errorNginx root based on hostname without wwwWhy Nginx calls for invalid certificate in non-existent subdomains just to redirect to 404?NGINX Calling page will download strange file + Certbot can't install certificateNginx reverse proxy to many local servers + webserver duty













0















I have my production site set up and now I'm trying to setup a dev/staging site to run live tests in.



I'm having issues pointing my subdomain to the correct root path on my Laravel app.



I need the following:




  • dev.example.com to point to root /var/www/dev/public;

  • example.com and www.example.com to point to root /var/www/laravel/public;

  • currently everything is going to /var/www/laravel/public


Server:




  • Ubuntu 18.10 x64

  • Nginx


I have a domain example.com and I made a subdomain called dev.example.com
each reference to the domain is in my SSL Cert via certbot/LetsEncrypt. www.example.com, example.com and dev.example.com



DNS for Subdomain:



A (Record) | dev (Name) | 140.xx.xx.xx (Data)



I have 2 folders located here:




  • /var/www/laravel/public (My Main Production site)

  • /var/www/dev/public (My Development Site)


In sites-available /etc/nginx/sites-available I have the default file with the following configurations.



(I've tried multiple variation of this, but this is where I left off)



 server {

root /var/www/laravel/public;

index index.php index.html index.htm index.nginx-debian.html;

server_name example.com www.example.com dev.example.com;

location / {
try_files $uri $uri/ /index.php?$query_string;
client_max_body_size 200M;
}

location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}

location ~ /.ht {
deny all;
}

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/povertyresolutions.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/povertyresolutions.org/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

# Virtual Host configuration for example.com

server {

if ($host = dev.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
listen [::]:80;
server_name dev.example.com;
root /var/www/dev/public;
return 404; # managed by Certbot

}

server {

if ($host = www.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
listen [::]:80;
server_name www.example.com;
return 404; # managed by Certbot

}

server {

if ($host = example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot

listen 80 default_server;
listen [::]:80;
server_name example.com;
return 404; # managed by Certbot

}



Again...




  • I need dev.example.com to point to root /var/www/dev/public;


  • I need example.com and www.example.com to point to root /var/www/laravel/public;



Any help in figuring this out would be appreciated.









share







New contributor




cwd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I have my production site set up and now I'm trying to setup a dev/staging site to run live tests in.



    I'm having issues pointing my subdomain to the correct root path on my Laravel app.



    I need the following:




    • dev.example.com to point to root /var/www/dev/public;

    • example.com and www.example.com to point to root /var/www/laravel/public;

    • currently everything is going to /var/www/laravel/public


    Server:




    • Ubuntu 18.10 x64

    • Nginx


    I have a domain example.com and I made a subdomain called dev.example.com
    each reference to the domain is in my SSL Cert via certbot/LetsEncrypt. www.example.com, example.com and dev.example.com



    DNS for Subdomain:



    A (Record) | dev (Name) | 140.xx.xx.xx (Data)



    I have 2 folders located here:




    • /var/www/laravel/public (My Main Production site)

    • /var/www/dev/public (My Development Site)


    In sites-available /etc/nginx/sites-available I have the default file with the following configurations.



    (I've tried multiple variation of this, but this is where I left off)



     server {

    root /var/www/laravel/public;

    index index.php index.html index.htm index.nginx-debian.html;

    server_name example.com www.example.com dev.example.com;

    location / {
    try_files $uri $uri/ /index.php?$query_string;
    client_max_body_size 200M;
    }

    location ~ .php$ {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    }

    location ~ /.ht {
    deny all;
    }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/povertyresolutions.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/povertyresolutions.org/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    }

    # Virtual Host configuration for example.com

    server {

    if ($host = dev.example.com) {
    return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    listen [::]:80;
    server_name dev.example.com;
    root /var/www/dev/public;
    return 404; # managed by Certbot

    }

    server {

    if ($host = www.example.com) {
    return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    listen [::]:80;
    server_name www.example.com;
    return 404; # managed by Certbot

    }

    server {

    if ($host = example.com) {
    return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80 default_server;
    listen [::]:80;
    server_name example.com;
    return 404; # managed by Certbot

    }



    Again...




    • I need dev.example.com to point to root /var/www/dev/public;


    • I need example.com and www.example.com to point to root /var/www/laravel/public;



    Any help in figuring this out would be appreciated.









    share







    New contributor




    cwd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have my production site set up and now I'm trying to setup a dev/staging site to run live tests in.



      I'm having issues pointing my subdomain to the correct root path on my Laravel app.



      I need the following:




      • dev.example.com to point to root /var/www/dev/public;

      • example.com and www.example.com to point to root /var/www/laravel/public;

      • currently everything is going to /var/www/laravel/public


      Server:




      • Ubuntu 18.10 x64

      • Nginx


      I have a domain example.com and I made a subdomain called dev.example.com
      each reference to the domain is in my SSL Cert via certbot/LetsEncrypt. www.example.com, example.com and dev.example.com



      DNS for Subdomain:



      A (Record) | dev (Name) | 140.xx.xx.xx (Data)



      I have 2 folders located here:




      • /var/www/laravel/public (My Main Production site)

      • /var/www/dev/public (My Development Site)


      In sites-available /etc/nginx/sites-available I have the default file with the following configurations.



      (I've tried multiple variation of this, but this is where I left off)



       server {

      root /var/www/laravel/public;

      index index.php index.html index.htm index.nginx-debian.html;

      server_name example.com www.example.com dev.example.com;

      location / {
      try_files $uri $uri/ /index.php?$query_string;
      client_max_body_size 200M;
      }

      location ~ .php$ {
      include snippets/fastcgi-php.conf;
      fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
      }

      location ~ /.ht {
      deny all;
      }

      listen [::]:443 ssl ipv6only=on; # managed by Certbot
      listen 443 ssl; # managed by Certbot
      ssl_certificate /etc/letsencrypt/live/povertyresolutions.org/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/povertyresolutions.org/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

      }

      # Virtual Host configuration for example.com

      server {

      if ($host = dev.example.com) {
      return 301 https://$host$request_uri;
      } # managed by Certbot

      listen 80;
      listen [::]:80;
      server_name dev.example.com;
      root /var/www/dev/public;
      return 404; # managed by Certbot

      }

      server {

      if ($host = www.example.com) {
      return 301 https://$host$request_uri;
      } # managed by Certbot

      listen 80;
      listen [::]:80;
      server_name www.example.com;
      return 404; # managed by Certbot

      }

      server {

      if ($host = example.com) {
      return 301 https://$host$request_uri;
      } # managed by Certbot

      listen 80 default_server;
      listen [::]:80;
      server_name example.com;
      return 404; # managed by Certbot

      }



      Again...




      • I need dev.example.com to point to root /var/www/dev/public;


      • I need example.com and www.example.com to point to root /var/www/laravel/public;



      Any help in figuring this out would be appreciated.









      share







      New contributor




      cwd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have my production site set up and now I'm trying to setup a dev/staging site to run live tests in.



      I'm having issues pointing my subdomain to the correct root path on my Laravel app.



      I need the following:




      • dev.example.com to point to root /var/www/dev/public;

      • example.com and www.example.com to point to root /var/www/laravel/public;

      • currently everything is going to /var/www/laravel/public


      Server:




      • Ubuntu 18.10 x64

      • Nginx


      I have a domain example.com and I made a subdomain called dev.example.com
      each reference to the domain is in my SSL Cert via certbot/LetsEncrypt. www.example.com, example.com and dev.example.com



      DNS for Subdomain:



      A (Record) | dev (Name) | 140.xx.xx.xx (Data)



      I have 2 folders located here:




      • /var/www/laravel/public (My Main Production site)

      • /var/www/dev/public (My Development Site)


      In sites-available /etc/nginx/sites-available I have the default file with the following configurations.



      (I've tried multiple variation of this, but this is where I left off)



       server {

      root /var/www/laravel/public;

      index index.php index.html index.htm index.nginx-debian.html;

      server_name example.com www.example.com dev.example.com;

      location / {
      try_files $uri $uri/ /index.php?$query_string;
      client_max_body_size 200M;
      }

      location ~ .php$ {
      include snippets/fastcgi-php.conf;
      fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
      }

      location ~ /.ht {
      deny all;
      }

      listen [::]:443 ssl ipv6only=on; # managed by Certbot
      listen 443 ssl; # managed by Certbot
      ssl_certificate /etc/letsencrypt/live/povertyresolutions.org/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/povertyresolutions.org/privkey.pem; # managed by Certbot
      include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

      }

      # Virtual Host configuration for example.com

      server {

      if ($host = dev.example.com) {
      return 301 https://$host$request_uri;
      } # managed by Certbot

      listen 80;
      listen [::]:80;
      server_name dev.example.com;
      root /var/www/dev/public;
      return 404; # managed by Certbot

      }

      server {

      if ($host = www.example.com) {
      return 301 https://$host$request_uri;
      } # managed by Certbot

      listen 80;
      listen [::]:80;
      server_name www.example.com;
      return 404; # managed by Certbot

      }

      server {

      if ($host = example.com) {
      return 301 https://$host$request_uri;
      } # managed by Certbot

      listen 80 default_server;
      listen [::]:80;
      server_name example.com;
      return 404; # managed by Certbot

      }



      Again...




      • I need dev.example.com to point to root /var/www/dev/public;


      • I need example.com and www.example.com to point to root /var/www/laravel/public;



      Any help in figuring this out would be appreciated.







      ubuntu nginx subdomain





      share







      New contributor




      cwd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      cwd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      cwd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 mins ago









      cwdcwd

      1011




      1011




      New contributor




      cwd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      cwd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      cwd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          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
          });


          }
          });






          cwd is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f960354%2fhow-do-i-point-my-subdomain-to-correct-root-folder%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








          cwd is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          cwd is a new contributor. Be nice, and check out our Code of Conduct.













          cwd is a new contributor. Be nice, and check out our Code of Conduct.












          cwd is a new contributor. Be nice, and check out our Code of Conduct.
















          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%2f960354%2fhow-do-i-point-my-subdomain-to-correct-root-folder%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

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...