Update 'Extra_Domains/RevProxySimple_Domain.sh'
This commit is contained in:
@@ -34,6 +34,7 @@ server {
|
||||
proxy_set_header X-Real-IP \$remote_addr;
|
||||
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||
proxy_set_header Host \$host;
|
||||
proxy_set_header X-Forwarded-Proto \$scheme;
|
||||
}
|
||||
|
||||
location ~ \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|html|htm)(\\n|\?ver=[0-9.])\$ {
|
||||
@@ -79,7 +80,7 @@ if [ $netdata = 1 ]; then
|
||||
apt install -y netdata
|
||||
sed -i 's/SEND_EMAIL="YES"/SEND_EMAIL="NO"/g' /etc/netdata/health_alarm_notify.conf
|
||||
ufw allow 19999/tcp
|
||||
sed -i 's+#netdata placeholder+upstream netdata {\n server 127.0.0.1:19999;\n keepalive 64;\n}+g'
|
||||
sed -i 's+#netdata placeholder+upstream netdata {\n server 127.0.0.1:19999;\n keepalive 64;\n}+g' /etc/nginx/sites-available/"$domain"
|
||||
sed -i 's+#netdata here+location = /netdata {\n return 301 /netdata/;\n }\n\n location ~ /netdata/(?<ndpath>.*) {\n proxy_redirect off;\n proxy_set_header Host \$host;\n proxy_set_header X-Forwarded-Host \$host;\n proxy_set_header X-Forwarded-Server \$host;\n proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;\n proxy_http_version 1.1;\n proxy_pass_request_headers on;\n proxy_set_header Connection "keep-alive";\n proxy_store off;\n proxy_pass http://netdata/\$ndpath\$is_args\$args;\n }+g' /etc/nginx/sites-available/"$domain"
|
||||
# systemctl stop netdata
|
||||
# systemctl disable netdata
|
||||
@@ -99,7 +100,7 @@ sed -i 's#include /etc/letsencrypt/options-ssl-nginx.conf;#ssl_ciphers EECDH+CHA
|
||||
##---------------##
|
||||
|
||||
if [ $wordpress = 1 ]; then
|
||||
db_suffix=$(ls -l /var/www | grep -c ^d)
|
||||
db_suffix=`expr $(ls -l /var/www | grep -c ^d) - 1`
|
||||
db_name="wp_$db_suffix"
|
||||
db_user="wp_$db_suffix"
|
||||
db_pass=$(date +%s|sha256sum|base64|head -c 32)
|
||||
@@ -142,6 +143,16 @@ define('WP_DEBUG', false);
|
||||
if ( !defined('ABSPATH') )
|
||||
define('ABSPATH', dirname(__FILE__) . '/');
|
||||
|
||||
/**
|
||||
* Handle SSL reverse proxy
|
||||
*/
|
||||
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
|
||||
$_SERVER['HTTPS']='on';
|
||||
|
||||
if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
|
||||
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
|
||||
}
|
||||
|
||||
#\$memcached_servers = array(
|
||||
# 'default' => array(
|
||||
# '127.0.0.1:11211'
|
||||
|
||||
Reference in New Issue
Block a user