Created
September 12, 2019 11:56
-
-
Save flaudanum/33d70634ebc5797d24da22853a295576 to your computer and use it in GitHub Desktop.
NginX - Location with a root that differs from the default one
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| # Listening to port 80 (default port for HTTP protocol) | |
| listen 80 default_server; | |
| listen [::]:80 default_server; | |
| # Default local root path for web resources | |
| root /var/www/html; | |
| # Add index.php to the list if you are using PHP | |
| index index.html index.htm index.nginx-debian.html; | |
| server_name _; | |
| location /opteasoft-core-docs/ { | |
| # This root differs from the default /var/www/html | |
| root /data/www/; | |
| # First attempt to serve request as file, then | |
| # as directory, then fall back to displaying a 404. | |
| try_files $uri $uri/ =404; | |
| } | |
| # Default location | |
| location / { | |
| # First attempt to serve request as file, then | |
| # as directory, then fall back to displaying a 404. | |
| try_files $uri $uri/ =404; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment