mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-04 17:06:49 +00:00
Compare commits
2 Commits
c377db5d62
...
v2.12.1
Author | SHA1 | Date | |
---|---|---|---|
5084cb7296 | |||
e677bfa2e8 |
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@ -43,7 +43,7 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
// Defaults to the Branch name, which is applies to all branches AND pr's
|
// Defaults to the Branch name, which is applies to all branches AND pr's
|
||||||
buildxPushTags = "-t docker.io/nginxproxymanager/${IMAGE}-dev:${BRANCH_LOWER}"
|
buildxPushTags = "-t docker.io/jc21/${IMAGE}:github-${BRANCH_LOWER}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -203,13 +203,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
npmGithubPrComment("""Docker Image for build ${BUILD_NUMBER} is available on
|
npmGithubPrComment("Docker Image for build ${BUILD_NUMBER} is available on [DockerHub](https://cloud.docker.com/repository/docker/jc21/${IMAGE}) as `jc21/${IMAGE}:github-${BRANCH_LOWER}`\n\n**Note:** ensure you backup your NPM instance before testing this PR image! Especially if this PR contains database changes.", true)
|
||||||
[DockerHub](https://cloud.docker.com/repository/docker/nginxproxymanager/${IMAGE}-dev)
|
|
||||||
as `nginxproxymanager/${IMAGE}-dev:${BRANCH_LOWER}`
|
|
||||||
|
|
||||||
**Note:** ensure you backup your NPM instance before testing this image! Especially if there are database changes
|
|
||||||
**Note:** this is a different docker image namespace than the official image
|
|
||||||
""", true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,20 +5,6 @@ const config = require('../lib/config');
|
|||||||
const utils = require('../lib/utils');
|
const utils = require('../lib/utils');
|
||||||
const error = require('../lib/error');
|
const error = require('../lib/error');
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {int} user_port
|
|
||||||
* @param {int} default_port
|
|
||||||
* @returns {int} port
|
|
||||||
*/
|
|
||||||
const validatePort = (user_port, default_port) => {
|
|
||||||
if (isNaN(user_port) || user_port < 1 || user_port > 65535) {
|
|
||||||
console.error(`Environment variable HTTP_PORT must be an integer between 1 and 65535 (got: ${user_port}). Using default port ${default_port}`);
|
|
||||||
return default_port;
|
|
||||||
}
|
|
||||||
return user_port;
|
|
||||||
};
|
|
||||||
|
|
||||||
const internalNginx = {
|
const internalNginx = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -246,10 +232,8 @@ const internalNginx = {
|
|||||||
locationsPromise = Promise.resolve();
|
locationsPromise = Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the IPv6 and port setting for the host
|
// Set the IPv6 setting for the host
|
||||||
host.ipv6 = internalNginx.ipv6Enabled();
|
host.ipv6 = internalNginx.ipv6Enabled();
|
||||||
host.http_port = internalNginx.httpPort();
|
|
||||||
host.https_port = internalNginx.httpsPort();
|
|
||||||
|
|
||||||
locationsPromise.then(() => {
|
locationsPromise.then(() => {
|
||||||
renderEngine
|
renderEngine
|
||||||
@ -303,9 +287,7 @@ const internalNginx = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
certificate.ipv6 = internalNginx.ipv6Enabled();
|
certificate.ipv6 = internalNginx.ipv6Enabled();
|
||||||
certificate.http_port = internalNginx.httpPort();
|
|
||||||
certificate.https_port = internalNginx.httpsPort();
|
|
||||||
|
|
||||||
renderEngine
|
renderEngine
|
||||||
.parseAndRender(template, certificate)
|
.parseAndRender(template, certificate)
|
||||||
@ -450,30 +432,7 @@ const internalNginx = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns {integer}
|
|
||||||
*/
|
|
||||||
httpPort: function () {
|
|
||||||
if (typeof process.env.HTTP_PORT !== 'undefined') {
|
|
||||||
let httpPort = parseInt(process.env.HTTP_PORT);
|
|
||||||
return validatePort(httpPort, 443);
|
|
||||||
}
|
|
||||||
return 80;
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @returns {integer}
|
|
||||||
*/
|
|
||||||
httpsPort: function () {
|
|
||||||
if (typeof process.env.HTTPS_PORT !== 'undefined') {
|
|
||||||
let httpPort = parseInt(process.env.HTTPS_PORT);
|
|
||||||
return validatePort(httpPort, 443);
|
|
||||||
}
|
|
||||||
return 80;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = internalNginx;
|
module.exports = internalNginx;
|
||||||
|
@ -49,7 +49,8 @@
|
|||||||
"minLength": 1
|
"minLength": 1
|
||||||
},
|
},
|
||||||
"password": {
|
"password": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"minLength": 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
auth_basic "Authorization required";
|
auth_basic "Authorization required";
|
||||||
auth_basic_user_file /data/access/{{ access_list_id }};
|
auth_basic_user_file /data/access/{{ access_list_id }};
|
||||||
|
|
||||||
{% if access_list.pass_auth == 0 or access_list.pass_auth == true %}
|
{% if access_list.pass_auth == 0 %}
|
||||||
proxy_set_header Authorization "";
|
proxy_set_header Authorization "";
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
@ -17,7 +17,7 @@
|
|||||||
deny all;
|
deny all;
|
||||||
|
|
||||||
# Access checks must...
|
# Access checks must...
|
||||||
{% if access_list.satisfy_any == 1 or access_list.satisfy_any == true %}
|
{% if access_list.satisfy_any == 1 %}
|
||||||
satisfy any;
|
satisfy any;
|
||||||
{% else %}
|
{% else %}
|
||||||
satisfy all;
|
satisfy all;
|
||||||
|
@ -1,20 +1,15 @@
|
|||||||
listen {{ http_port }};
|
listen 80;
|
||||||
{% if ipv6 -%}
|
{% if ipv6 -%}
|
||||||
listen [::]:{{ http_port }};
|
listen [::]:80;
|
||||||
{% else -%}
|
{% else -%}
|
||||||
#listen [::]:{{ http_port }};
|
#listen [::]:80;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if certificate -%}
|
{% if certificate -%}
|
||||||
listen {{ https_port }} ssl;
|
listen 443 ssl{% if http2_support == 1 or http2_support == true %} http2{% endif %};
|
||||||
{% if ipv6 -%}
|
{% if ipv6 -%}
|
||||||
listen [::]:{{ https_port }} ssl;
|
listen [::]:443 ssl{% if http2_support == 1 or http2_support == true %} http2{% endif %};
|
||||||
{% else -%}
|
{% else -%}
|
||||||
#listen [::]:{{ https_port }};
|
#listen [::]:443;
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
server_name {{ domain_names | join: " " }};
|
server_name {{ domain_names | join: " " }};
|
||||||
{% if http2_support == 1 or http2_support == true %}
|
|
||||||
http2 on;
|
|
||||||
{% else -%}
|
|
||||||
http2 off;
|
|
||||||
{% endif %}
|
|
@ -7,7 +7,11 @@
|
|||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|
||||||
proxy_pass {{ forward_scheme }}://{{ forward_host }}:{{ forward_port }}{{ forward_path }};
|
set $proxy_forward_scheme {{ forward_scheme }};
|
||||||
|
set $proxy_server "{{ forward_host }}";
|
||||||
|
set $proxy_port {{ forward_port }};
|
||||||
|
|
||||||
|
proxy_pass $proxy_forward_scheme://$proxy_server:$proxy_port{{ forward_path }};
|
||||||
|
|
||||||
{% include "_access.conf" %}
|
{% include "_access.conf" %}
|
||||||
{% include "_assets.conf" %}
|
{% include "_assets.conf" %}
|
||||||
|
@ -33,8 +33,6 @@ services:
|
|||||||
DB_MYSQL_NAME: 'npm'
|
DB_MYSQL_NAME: 'npm'
|
||||||
# DB_SQLITE_FILE: "/data/database.sqlite"
|
# DB_SQLITE_FILE: "/data/database.sqlite"
|
||||||
# DISABLE_IPV6: "true"
|
# DISABLE_IPV6: "true"
|
||||||
# HTTP_PORT: "1234"
|
|
||||||
# HTTPS_PORT: "5678"
|
|
||||||
# Required for DNS Certificate provisioning testing:
|
# Required for DNS Certificate provisioning testing:
|
||||||
LE_SERVER: 'https://ca.internal/acme/acme/directory'
|
LE_SERVER: 'https://ca.internal/acme/acme/directory'
|
||||||
REQUESTS_CA_BUNDLE: '/etc/ssl/certs/NginxProxyManager.crt'
|
REQUESTS_CA_BUNDLE: '/etc/ssl/certs/NginxProxyManager.crt'
|
||||||
|
@ -18,6 +18,5 @@ fi
|
|||||||
. /etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh
|
. /etc/s6-overlay/s6-rc.d/prepare/30-ownership.sh
|
||||||
. /etc/s6-overlay/s6-rc.d/prepare/40-dynamic.sh
|
. /etc/s6-overlay/s6-rc.d/prepare/40-dynamic.sh
|
||||||
. /etc/s6-overlay/s6-rc.d/prepare/50-ipv6.sh
|
. /etc/s6-overlay/s6-rc.d/prepare/50-ipv6.sh
|
||||||
. /etc/s6-overlay/s6-rc.d/prepare/55-http-https-port.sh
|
|
||||||
. /etc/s6-overlay/s6-rc.d/prepare/60-secrets.sh
|
. /etc/s6-overlay/s6-rc.d/prepare/60-secrets.sh
|
||||||
. /etc/s6-overlay/s6-rc.d/prepare/90-banner.sh
|
. /etc/s6-overlay/s6-rc.d/prepare/90-banner.sh
|
||||||
|
@ -1,59 +0,0 @@
|
|||||||
#!/command/with-contenv bash
|
|
||||||
# shellcheck shell=bash
|
|
||||||
|
|
||||||
# This command reads the `HTTP_PORT` and `HTTPS_PORT` env vars and will rerender
|
|
||||||
# the nginx files to the port defined in these variables
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
log_info 'HTTP_PORT ...'
|
|
||||||
|
|
||||||
DEFAULT_HTTP_PORT="80"
|
|
||||||
DEFAULT_HTTPS_PORT="443"
|
|
||||||
|
|
||||||
# Make sure HTTP_PORT and HTTPS_PORT are set correctly
|
|
||||||
case "$HTTP_PORT" in
|
|
||||||
''|*[!0-9]*)
|
|
||||||
echo "Could not parse HTTP_PORT as integer (got \"$HTTP_PORT\")."
|
|
||||||
echo "Using default http port \"$DEFAULT_HTTP_PORT\""
|
|
||||||
HTTP_PORT="$DEFAULT_HTTP_PORT"
|
|
||||||
;;
|
|
||||||
*) true ;;
|
|
||||||
esac
|
|
||||||
if [ "$HTTP_PORT" -lt "1" ] || [ "$HTTP_PORT" -gt "65535" ]; then
|
|
||||||
echo "HTTP_PORT must be between 1 and 65535 (got \"$HTTP_PORT\")."
|
|
||||||
echo "Using default http port \"$DEFAULT_HTTP_PORT\""
|
|
||||||
HTTP_PORT="$DEFAULT_HTTP_PORT"
|
|
||||||
fi
|
|
||||||
case "$HTTPS_PORT" in
|
|
||||||
''|*[!0-9]*)
|
|
||||||
echo "Could not parse HTTPS_PORT as integer (got \"$HTTPS_PORT\")."
|
|
||||||
echo "Using default https port \"$DEFAULT_HTTPS_PORT\""
|
|
||||||
HTTPS_PORT="$DEFAULT_HTTPS_PORT"
|
|
||||||
;;
|
|
||||||
*) true ;;
|
|
||||||
esac
|
|
||||||
if [ "$HTTPS_PORT" -lt "1" ] || [ "$HTTPS_PORT" -gt "65535" ]; then
|
|
||||||
echo "HTTPS_PORT must be between 1 and 65535 (got \"$HTTPS_PORT\")."
|
|
||||||
echo "Using default https port \"$DEFAULT_HTTPS_PORT\""
|
|
||||||
HTTPS_PORT="$DEFAULT_HTTPS_PORT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
process_folder () {
|
|
||||||
FILES=$(find "$1" -type f -name "*.conf")
|
|
||||||
|
|
||||||
HTTP_SED_REGEX='/ssl/! s/listen (\[::\]:)?[0-9]+/listen \1'$HTTP_PORT'/g'
|
|
||||||
HTTPS_SED_REGEX='/ssl/ s/listen (\[::\]:)?[0-9]+/listen \1'$HTTPS_PORT'/g'
|
|
||||||
|
|
||||||
for FILE in $FILES
|
|
||||||
do
|
|
||||||
echo "- ${FILE}"
|
|
||||||
echo "$(sed -E "$HTTP_SED_REGEX" "$FILE")" > $FILE
|
|
||||||
echo "$(sed -E "$HTTPS_SED_REGEX" "$FILE")" > $FILE
|
|
||||||
done
|
|
||||||
|
|
||||||
# ensure the files are still owned by the npm user
|
|
||||||
chown -R "$PUID:$PGID" "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
process_folder /data/nginx
|
|
@ -164,18 +164,6 @@ The easy fix is to add a Docker environment variable to the Nginx Proxy Manager
|
|||||||
DISABLE_IPV6: 'true'
|
DISABLE_IPV6: 'true'
|
||||||
```
|
```
|
||||||
|
|
||||||
## Chaning the HTTP and HTTPS Listen Port
|
|
||||||
|
|
||||||
If you are unable to configure the port mapping within Docker (eg. when using
|
|
||||||
`hostNetwork: true`) you can change the port that proxy-hosts and
|
|
||||||
redirection-hosts listen on by setting the environment variables `HTTP_PORT` and
|
|
||||||
`HTTPS_PORT`:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
environment:
|
|
||||||
HTTP_PORT: "1234"
|
|
||||||
HTTPS_PORT: "5678"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Custom Nginx Configurations
|
## Custom Nginx Configurations
|
||||||
|
|
||||||
|
@ -137,13 +137,5 @@ Email: admin@example.com
|
|||||||
Password: changeme
|
Password: changeme
|
||||||
```
|
```
|
||||||
|
|
||||||
Immediately after logging in with this default user you will be asked to modify your details and change your password. You can change defaults with:
|
Immediately after logging in with this default user you will be asked to modify your details and change your password.
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
environment:
|
|
||||||
INITIAL_ADMIN_EMAIL: my@example.com
|
|
||||||
INITIAL_ADMIN_PASSWORD: mypassword1
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"credentials": "dns_acmedns_api_url = http://acmedns-server/\ndns_acmedns_registration_file = /data/acme-registration.json",
|
"credentials": "dns_acmedns_api_url = http://acmedns-server/\ndns_acmedns_registration_file = /data/acme-registration.json",
|
||||||
"full_plugin_name": "dns-acmedns"
|
"full_plugin_name": "dns-acmedns"
|
||||||
},
|
},
|
||||||
"active24":{
|
"active24":{
|
||||||
"name": "Active24",
|
"name": "Active24",
|
||||||
"package_name": "certbot-dns-active24",
|
"package_name": "certbot-dns-active24",
|
||||||
"version": "~=1.5.1",
|
"version": "~=1.5.1",
|
||||||
@ -303,14 +303,6 @@
|
|||||||
"credentials": "dns_joker_username = <Dynamic DNS Authentication Username>\ndns_joker_password = <Dynamic DNS Authentication Password>\ndns_joker_domain = <Dynamic DNS Domain>",
|
"credentials": "dns_joker_username = <Dynamic DNS Authentication Username>\ndns_joker_password = <Dynamic DNS Authentication Password>\ndns_joker_domain = <Dynamic DNS Domain>",
|
||||||
"full_plugin_name": "dns-joker"
|
"full_plugin_name": "dns-joker"
|
||||||
},
|
},
|
||||||
"leaseweb": {
|
|
||||||
"name": "LeaseWeb",
|
|
||||||
"package_name": "certbot-dns-leaseweb",
|
|
||||||
"version": "~=1.0.1",
|
|
||||||
"dependencies": "",
|
|
||||||
"credentials": "dns_leaseweb_api_token = 01234556789",
|
|
||||||
"full_plugin_name": "dns-leaseweb"
|
|
||||||
},
|
|
||||||
"linode": {
|
"linode": {
|
||||||
"name": "Linode",
|
"name": "Linode",
|
||||||
"package_name": "certbot-dns-linode",
|
"package_name": "certbot-dns-linode",
|
||||||
@ -432,13 +424,13 @@
|
|||||||
"full_plugin_name": "dns-rfc2136"
|
"full_plugin_name": "dns-rfc2136"
|
||||||
},
|
},
|
||||||
"rockenstein": {
|
"rockenstein": {
|
||||||
"name": "rockenstein AG",
|
"name": "rockenstein AG",
|
||||||
"package_name": "certbot-dns-rockenstein",
|
"package_name": "certbot-dns-rockenstein",
|
||||||
"version": "~=1.0.0",
|
"version": "~=1.0.0",
|
||||||
"dependencies": "",
|
"dependencies": "",
|
||||||
"credentials": "dns_rockenstein_token=<token>",
|
"credentials": "dns_rockenstein_token=<token>",
|
||||||
"full_plugin_name": "dns-rockenstein"
|
"full_plugin_name": "dns-rockenstein"
|
||||||
},
|
},
|
||||||
"route53": {
|
"route53": {
|
||||||
"name": "Route 53 (Amazon)",
|
"name": "Route 53 (Amazon)",
|
||||||
"package_name": "certbot-dns-route53",
|
"package_name": "certbot-dns-route53",
|
||||||
|
Reference in New Issue
Block a user