Default directory for nginx?Trouble with nginx and serving from multiple directories under the same domainCan...

How do I create uniquely male characters?

Does the radius of the Spirit Guardians spell depend on the size of the caster?

LED on same Pin as Toggle Switch, not illuminating

XeLaTeX and pdfLaTeX ignore hyphenation

Why CLRS example on residual networks does not follows its formula?

How does one intimidate enemies without having the capacity for violence?

Why is this code 6.5x slower with optimizations enabled?

Example of a relative pronoun

Non-Jewish family in an Orthodox Jewish Wedding

What do you call a Matrix-like slowdown and camera movement effect?

Why was the small council so happy for Tyrion to become the Master of Coin?

How do you conduct xenoanthropology after first contact?

Should I join an office cleaning event for free?

How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?

What typically incentivizes a professor to change jobs to a lower ranking university?

Draw simple lines in Inkscape

I probably found a bug with the sudo apt install function

Is there a familial term for apples and pears?

Infinite past with a beginning?

I see my dog run

Why is the design of haulage companies so “special”?

What is the white spray-pattern residue inside these Falcon Heavy nozzles?

How to calculate implied correlation via observed market price (Margrabe option)

Chess with symmetric move-square



Default directory for nginx?


Trouble with nginx and serving from multiple directories under the same domainCan not change nginx 1.2.5 default websiteChange root of server block in nginx?Nginx won't accept my location configurationLocation in nginx keeps returning 404Wordpress images broken after upload on ubuntu 14.04nginx configuration troublenginx PHP files downloading instead of executingNginx only recognises files in root dir (Permission denied on symlink'ed dir/files)Nginx and different types of alias






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I have ubuntu 15.04. After searching I found a variety of links that suggest the default directory for for nginx is /usr/share/nginx/html. It looks like that directory was created and there was already an index.html file at that location. I tried to add another html file and found that I could not browse to that location. I then found another links suggesting /var/www/html which I also created a test html file and was able pull back the file. Why do both directories exist and what is the difference between them?










share|improve this question
















bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Anything under /usr would not typically be modifiable by normal users (eg. www-data). /var/www/html would make more sense. I can't speak specifics though because I typically compile nginx from source where the default is /var/nginx/html. The Ubuntu nginx tends to be horribly out of date even in current releases.

    – CR.
    Sep 2 '15 at 3:17













  • Please go through older post unix.stackexchange.com/questions/110328/… Hope it would helpful.

    – sanjayparmar
    Aug 10 '18 at 5:18


















1















I have ubuntu 15.04. After searching I found a variety of links that suggest the default directory for for nginx is /usr/share/nginx/html. It looks like that directory was created and there was already an index.html file at that location. I tried to add another html file and found that I could not browse to that location. I then found another links suggesting /var/www/html which I also created a test html file and was able pull back the file. Why do both directories exist and what is the difference between them?










share|improve this question
















bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Anything under /usr would not typically be modifiable by normal users (eg. www-data). /var/www/html would make more sense. I can't speak specifics though because I typically compile nginx from source where the default is /var/nginx/html. The Ubuntu nginx tends to be horribly out of date even in current releases.

    – CR.
    Sep 2 '15 at 3:17













  • Please go through older post unix.stackexchange.com/questions/110328/… Hope it would helpful.

    – sanjayparmar
    Aug 10 '18 at 5:18














1












1








1








I have ubuntu 15.04. After searching I found a variety of links that suggest the default directory for for nginx is /usr/share/nginx/html. It looks like that directory was created and there was already an index.html file at that location. I tried to add another html file and found that I could not browse to that location. I then found another links suggesting /var/www/html which I also created a test html file and was able pull back the file. Why do both directories exist and what is the difference between them?










share|improve this question
















I have ubuntu 15.04. After searching I found a variety of links that suggest the default directory for for nginx is /usr/share/nginx/html. It looks like that directory was created and there was already an index.html file at that location. I tried to add another html file and found that I could not browse to that location. I then found another links suggesting /var/www/html which I also created a test html file and was able pull back the file. Why do both directories exist and what is the difference between them?







ubuntu nginx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 11 '18 at 10:48









Dave M

4,36982428




4,36982428










asked Sep 2 '15 at 3:03









coding4funcoding4fun

2171510




2171510





bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Anything under /usr would not typically be modifiable by normal users (eg. www-data). /var/www/html would make more sense. I can't speak specifics though because I typically compile nginx from source where the default is /var/nginx/html. The Ubuntu nginx tends to be horribly out of date even in current releases.

    – CR.
    Sep 2 '15 at 3:17













  • Please go through older post unix.stackexchange.com/questions/110328/… Hope it would helpful.

    – sanjayparmar
    Aug 10 '18 at 5:18



















  • Anything under /usr would not typically be modifiable by normal users (eg. www-data). /var/www/html would make more sense. I can't speak specifics though because I typically compile nginx from source where the default is /var/nginx/html. The Ubuntu nginx tends to be horribly out of date even in current releases.

    – CR.
    Sep 2 '15 at 3:17













  • Please go through older post unix.stackexchange.com/questions/110328/… Hope it would helpful.

    – sanjayparmar
    Aug 10 '18 at 5:18

















Anything under /usr would not typically be modifiable by normal users (eg. www-data). /var/www/html would make more sense. I can't speak specifics though because I typically compile nginx from source where the default is /var/nginx/html. The Ubuntu nginx tends to be horribly out of date even in current releases.

– CR.
Sep 2 '15 at 3:17







Anything under /usr would not typically be modifiable by normal users (eg. www-data). /var/www/html would make more sense. I can't speak specifics though because I typically compile nginx from source where the default is /var/nginx/html. The Ubuntu nginx tends to be horribly out of date even in current releases.

– CR.
Sep 2 '15 at 3:17















Please go through older post unix.stackexchange.com/questions/110328/… Hope it would helpful.

– sanjayparmar
Aug 10 '18 at 5:18





Please go through older post unix.stackexchange.com/questions/110328/… Hope it would helpful.

– sanjayparmar
Aug 10 '18 at 5:18










2 Answers
2






active

oldest

votes


















0














Both directories exist because both are needed, for different purposes.



/usr/share/nginx/html is the compiled-in default location for each server's document root, in the absence of one being specified.



/var/www/html is the configured location for the default server's document root as configured in /etc/nginx/sites-available/default.



Why use /var/www/html? Because a sysadmin may wish to modify the default vhost's document root, but the Filesystem Hierarchy Standard (which Ubuntu follows because it follows Debian, whose policy requires compliance with the FHS) requires that user-modifiable content go into /var (or /srv, or /home -- basically any number of places that aren't /usr).






share|improve this answer































    -1














    You need to open default vhost file (usually /etc/nginx/sites-enabled/default) and check the 'root' parameter. It points to root directory for default nginx vhost.



    Also, you may need to change permissions to your html page.



    chown www-data:www-data /path/to/your/html/page.html





    share|improve this answer
























      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%2f718449%2fdefault-directory-for-nginx%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      Both directories exist because both are needed, for different purposes.



      /usr/share/nginx/html is the compiled-in default location for each server's document root, in the absence of one being specified.



      /var/www/html is the configured location for the default server's document root as configured in /etc/nginx/sites-available/default.



      Why use /var/www/html? Because a sysadmin may wish to modify the default vhost's document root, but the Filesystem Hierarchy Standard (which Ubuntu follows because it follows Debian, whose policy requires compliance with the FHS) requires that user-modifiable content go into /var (or /srv, or /home -- basically any number of places that aren't /usr).






      share|improve this answer




























        0














        Both directories exist because both are needed, for different purposes.



        /usr/share/nginx/html is the compiled-in default location for each server's document root, in the absence of one being specified.



        /var/www/html is the configured location for the default server's document root as configured in /etc/nginx/sites-available/default.



        Why use /var/www/html? Because a sysadmin may wish to modify the default vhost's document root, but the Filesystem Hierarchy Standard (which Ubuntu follows because it follows Debian, whose policy requires compliance with the FHS) requires that user-modifiable content go into /var (or /srv, or /home -- basically any number of places that aren't /usr).






        share|improve this answer


























          0












          0








          0







          Both directories exist because both are needed, for different purposes.



          /usr/share/nginx/html is the compiled-in default location for each server's document root, in the absence of one being specified.



          /var/www/html is the configured location for the default server's document root as configured in /etc/nginx/sites-available/default.



          Why use /var/www/html? Because a sysadmin may wish to modify the default vhost's document root, but the Filesystem Hierarchy Standard (which Ubuntu follows because it follows Debian, whose policy requires compliance with the FHS) requires that user-modifiable content go into /var (or /srv, or /home -- basically any number of places that aren't /usr).






          share|improve this answer













          Both directories exist because both are needed, for different purposes.



          /usr/share/nginx/html is the compiled-in default location for each server's document root, in the absence of one being specified.



          /var/www/html is the configured location for the default server's document root as configured in /etc/nginx/sites-available/default.



          Why use /var/www/html? Because a sysadmin may wish to modify the default vhost's document root, but the Filesystem Hierarchy Standard (which Ubuntu follows because it follows Debian, whose policy requires compliance with the FHS) requires that user-modifiable content go into /var (or /srv, or /home -- basically any number of places that aren't /usr).







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 11 '18 at 4:57









          womblewomble

          85.7k18144204




          85.7k18144204

























              -1














              You need to open default vhost file (usually /etc/nginx/sites-enabled/default) and check the 'root' parameter. It points to root directory for default nginx vhost.



              Also, you may need to change permissions to your html page.



              chown www-data:www-data /path/to/your/html/page.html





              share|improve this answer




























                -1














                You need to open default vhost file (usually /etc/nginx/sites-enabled/default) and check the 'root' parameter. It points to root directory for default nginx vhost.



                Also, you may need to change permissions to your html page.



                chown www-data:www-data /path/to/your/html/page.html





                share|improve this answer


























                  -1












                  -1








                  -1







                  You need to open default vhost file (usually /etc/nginx/sites-enabled/default) and check the 'root' parameter. It points to root directory for default nginx vhost.



                  Also, you may need to change permissions to your html page.



                  chown www-data:www-data /path/to/your/html/page.html





                  share|improve this answer













                  You need to open default vhost file (usually /etc/nginx/sites-enabled/default) and check the 'root' parameter. It points to root directory for default nginx vhost.



                  Also, you may need to change permissions to your html page.



                  chown www-data:www-data /path/to/your/html/page.html






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Sep 2 '15 at 3:16









                  strangemanstrangeman

                  363317




                  363317






























                      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%2f718449%2fdefault-directory-for-nginx%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...

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

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