mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 18:16:26 +00:00
Added support for redirection and 404 hosts
This commit is contained in:
19
manager/src/backend/templates/404.conf.ejs
Normal file
19
manager/src/backend/templates/404.conf.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
# <%- hostname %>
|
||||
server {
|
||||
listen 80;
|
||||
<%- typeof ssl !== 'undefined' && ssl ? 'listen 443 ssl;' : '' %>
|
||||
|
||||
server_name <%- hostname %>;
|
||||
|
||||
access_log /config/logs/<%- hostname %>.log proxy;
|
||||
|
||||
<% if (typeof ssl !== 'undefined' && ssl) { -%>
|
||||
include conf.d/include/ssl-ciphers.conf;
|
||||
ssl_certificate /etc/letsencrypt/live/<%- hostname %>/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/<%- hostname %>/privkey.pem;
|
||||
<% } -%>
|
||||
|
||||
<%- typeof advanced !== 'undefined' && advanced ? advanced : '' %>
|
||||
|
||||
return 404;
|
||||
}
|
22
manager/src/backend/templates/redirection.conf.ejs
Normal file
22
manager/src/backend/templates/redirection.conf.ejs
Normal file
@ -0,0 +1,22 @@
|
||||
# <%- hostname %>
|
||||
server {
|
||||
listen 80;
|
||||
<%- typeof ssl !== 'undefined' && ssl ? 'listen 443 ssl;' : '' %>
|
||||
|
||||
server_name <%- hostname %>;
|
||||
|
||||
access_log /config/logs/<%- hostname %>.log proxy;
|
||||
|
||||
<%- typeof asset_caching !== 'undefined' && asset_caching ? 'include conf.d/include/assets.conf;' : '' %>
|
||||
<%- typeof block_exploits !== 'undefined' && block_exploits ? 'include conf.d/include/block-exploits.conf;' : '' %>
|
||||
|
||||
<% if (typeof ssl !== 'undefined' && ssl) { -%>
|
||||
include conf.d/include/ssl-ciphers.conf;
|
||||
ssl_certificate /etc/letsencrypt/live/<%- hostname %>/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/<%- hostname %>/privkey.pem;
|
||||
<% } -%>
|
||||
|
||||
<%- typeof advanced !== 'undefined' && advanced ? advanced : '' %>
|
||||
|
||||
return 301 $scheme://<%- forward_host %>$request_uri;
|
||||
}
|
Reference in New Issue
Block a user