How do I point my Subdomain to correct root folderapache + nginx(for only one subdomain)How do I point a domain to an Ubuntu VPS?Existing laravel 4 project gives 404 in browserLocal (non-root) installation folderMount point of network shared folderApache server does not respondUnable to stop nginx from redirecting to HTTPS on subdomainGet Apache2 running with nginx as reverse proxyEnable access through port address in subdomainnginx : websocket failed to connect

Unreliable Magic - Is it worth it?

Failed to fetch jessie backports repository

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

A particular customize with green line and letters for subfloat

Increase performance creating Mandelbrot set in python

Pre-amplifier input protection

Was Spock the First Vulcan in Starfleet?

Roman Numeral Treatment of Suspensions

Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?

Crossing the line between justified force and brutality

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

Hostile work environment after whistle-blowing on coworker and our boss. What do I do?

Large drywall patch supports

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

Why are there no referendums in the US?

How do scammers retract money, while you can’t?

Short story about space worker geeks who zone out by 'listening' to radiation from stars

Pole-zeros of a real-valued causal FIR system

Sequence of Tenses: Translating the subjunctive

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

How can we prove that any integral in the set of non-elementary integrals cannot be expressed in the form of elementary functions?

You cannot touch me, but I can touch you, who am I?

Is exact Kanji stroke length important?

What can we do to stop prior company from asking us questions?



How do I point my Subdomain to correct root folder


apache + nginx(for only one subdomain)How do I point a domain to an Ubuntu VPS?Existing laravel 4 project gives 404 in browserLocal (non-root) installation folderMount point of network shared folderApache server does not respondUnable to stop nginx from redirecting to HTTPS on subdomainGet Apache2 running with nginx as reverse proxyEnable access through port address in subdomainnginx : websocket failed to connect













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/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/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/example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com/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/example.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/example.com/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/example.com/fullchain.pem; # managed by Certbot
      ssl_certificate_key /etc/letsencrypt/live/example.com/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.







      16.04 18.10 nginx vps





      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 4 mins ago









      cwdcwd

      101




      101




      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: "89"
          ;
          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%2faskubuntu.com%2fquestions%2f1129294%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 Ask Ubuntu!


          • 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%2faskubuntu.com%2fquestions%2f1129294%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

          Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

          Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

          Torre de la Isleta Índice Véase también Referencias Bibliografía Enlaces externos Menú de navegación38°25′58″N 0°23′02″O / 38.43277778, -0.3838888938°25′58″N 0°23′02″O / 38.43277778, -0.38388889Torre de la Illeta de l’Horta o Torre Saleta. Base de datos de bienes inmuebles. Patrimonio Cultural. Secretaría de Estado de CulturaFicha BIC Torre de la Illeta de l’Horta. Dirección General de Patrimonio Cultural. Generalitat ValencianaLugares de interés. Ayuntamiento del CampelloTorre de la Isleta en CastillosNet.org