Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow including custom nginx conf files (#178)
* Allow including custom nginx conf files Give advanced users more flexibility by allowing them to include custom config files at differents locations in the nginx configuration. `/data/nginx/custom/root.conf`: Included at the very end of nginx.conf `/data/nginx/custom/http.conf`: Included at the end of the main `http` block `/data/nginx/custom/server_proxy.conf`: Included at the end of every proxy `server` block `/data/nginx/custom/server_redirect.conf`: Included at the end of every redirection `server` block `/data/nginx/custom/server_stream.conf`: Included at the end of every stream `server` block `/data/nginx/custom/server_stream_tcp.conf`: Included at the end of every TCP stream `server` block `/data/nginx/custom/server_stream_udp.conf`: Included at the end of every UDP stream `server` block * Don't fail if file doesn't exist * Advanced Nginx settings doc
- Loading branch information
Showing
5 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Advanced Nginx Configuration | ||
|
||
If you are a more advanced user, you might be itching for extra Nginx customizability. | ||
|
||
NPM has the ability to include different custom configuration snippets in different places. | ||
|
||
You can add your custom configuration snippet files at `/data/nginx/custom` as follow: | ||
|
||
`/data/nginx/custom/root.conf`: Included at the very end of nginx.conf | ||
`/data/nginx/custom/http.conf`: Included at the end of the main http block | ||
`/data/nginx/custom/server_proxy.conf`: Included at the end of every proxy server block | ||
`/data/nginx/custom/server_redirect.conf`: Included at the end of every redirection server block | ||
`/data/nginx/custom/server_stream.conf`: Included at the end of every stream server block | ||
`/data/nginx/custom/server_stream_tcp.conf`: Included at the end of every TCP stream server block | ||
`/data/nginx/custom/server_stream_udp.conf`: Included at the end of every UDP stream server block | ||
|
||
Every file is optional. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,5 +41,7 @@ server { | |
} | ||
{% endif %} | ||
|
||
# Custom | ||
include /data/nginx/custom/server_proxy[.]conf; | ||
} | ||
{% endif %} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,7 @@ server { | |
} | ||
{% endif %} | ||
|
||
# Custom | ||
include /data/nginx/custom/server_redirect[.]conf; | ||
} | ||
{% endif %} |
This file contains 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