- Joined
- Jul 23, 2014
- Messages
- 2
- Reaction score
- 0
Hi everyone, I have an on premise installation V20.8 and not too sure why but we kept getting ngnix failures, a quick start of the service would eventually get it going after several attempts. A few Window 11 updates and now it will not start at all.
The error log is as follows:
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in C:\Program Files\3CX Phone System\Bin\nginx/conf/nginx.conf:47
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in C:\Program Files\3CX Phone System\Bin\nginx/conf/nginx.conf:48
nginx: [warn] "ssl_stapling" ignored, no OCSP responder URL in the certificate "C:/ProgramData/3CX/Bin/nginx/conf/Instance1/domain_cert_********.3cx.uk.pem"
nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
Our actual nginx config file contains:
worker_processes auto;
events {
accept_mutex on;
worker_connections 10240;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' $http_connection;
}
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
limit_conn_zone $server_name zone=servers:10m;
geo $is_remote {
default 1;
192.168.0.0/16 0;
172.16.0.0/12 0;
10.0.0.0/8 0;
127.0.0.1 0;
}
upstream gateway {
server 127.0.0.1:5008;
keepalive 100;
}
upstream mc {
server 127.0.0.1:5004;
keepalive 100;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
listen 80;
listen [::]:80;
server_name ********.3cx.uk;
server_tokens off;
access_log off;
error_log nul crit;
if ($scheme = 'http'){
set $block_remote "1";
}
if ($is_remote){
set $block_remote "${block_remote}+1";
}
if ($block_remote = "1+1"){
return 403;
}
ssl_session_cache shared:SSL:60m;
ssl_session_timeout 1d;
ssl_stapling on;
ssl_stapling_verify on;
ssl_certificate "C:/ProgramData/3CX/Bin/nginx/conf/Instance1/domain_cert_********.3cx.uk.pem";
ssl_certificate_key "C:/ProgramData/3CX/Bin/nginx/conf/Instance1/domain_key_********.3cx.uk.pem";
ssl_prefer_server_ciphers on;
client_max_body_size 300m;
root "C:/ProgramData/3CX/Data/Http/wwwroot/webclient";
location ~ ^/webclient(?!(/api|/3cx-worker.js)) {
set $new_request_uri $request_uri;
if ($request_uri ~ ^/webclient(.*)$) {
set $new_request_uri $1;
}
return 302 $scheme://$server_name:$server_port$new_request_uri;
}
location /manager {
return 403;
}
location ~ ^/swagger {
include "mc.conf";
add_header X-Frame-Options "DENY";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "0";
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline'; img-src 'self' data:;";
add_header Strict-Transport-Security max-age=31536000;
}
location ~ ^/join/|^/meet/|^/open/|^/router|^/webmeeting|^/gateway {
# Limit of files is 4096 so we leave +1000 for system files here
limit_conn servers 2500;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1;mode=block";
add_header Content-Security-Policy "default-src 'self' *.3cx.net; style-src 'self' 'unsafe-inline' *.3cx.net; script-src 'self' 'unsafe-eval' *.3cx.net youtube.com www.youtube.com; worker-src blob:; frame-src 'self' www.youtube.com tcxwmrc:; connect-src *; img-src * data:;object-src 'none';";
add_header Strict-Transport-Security max-age=31536000 always;
add_header Referrer-Policy no-referrer;
add_header Cross-Origin-Opener-Policy same-origin;
add_header Permissions-Policy "geolocation=(),accelerometer=(),gamepad=(),magnetometer=(),midi=(),payment=(),serial=(),xr-spatial-tracking=()";
add_header Cross-Origin-Embedder-Policy credentialless;
add_header Cache-Control "no-store";
add_header Pragma "no-cache";
proxy_pass http://gateway;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~ ^/callus\.js|-worker\.js$|manifest\.webmanifest$|ngsw\.json$|index\.html$ {
include "shared-headers.conf";
add_header Cache-Control "no-cache";
add_header Pragma "no-cache";
add_header Permissions-Policy "geolocation=(),accelerometer=(),gamepad=(),magnetometer=(),midi=(),payment=(),serial=(),xr-spatial-tracking=()";
try_files $uri $uri/ @proxy;
}
location / {
include "shared-headers.conf";
add_header Cache-Control "public, immutable, max-age=31536000";
index index.html;
try_files $uri $uri/ @proxy;
}
location /user_images {
include "shared-headers.conf";
add_header Cache-Control "public, immutable, max-age=31536000";
root "C:/ProgramData/3CX/Data/Http/wwwroot";
try_files $uri $uri/;
}
location /MyPhone {
include "shared-headers.conf";
alias "C:/ProgramData/3CX/Instance1/Data/Http/Interface/MyPhone";
try_files $uri $uri/ @proxy;
}
location ~ ^(/xapi/v1/Report|/xapi/v1/ChatHistory|/xapi/v1/ChatMessages|/xapi/v1/InstallUpdates|/xapi/v1/Users/Pbx\.InstallFirmware|/xapi/v1/Users/Import) {
include "shared-headers.conf";
include "mc.conf";
proxy_read_timeout 1h;
}
location /xapi/v1/Firmwares {
include "shared-headers.conf";
include "mc.conf";
client_max_body_size 1G;
}
location @proxy {
include "shared-headers.conf";
include "mc.conf";
}
include "snippets/*.conf";
}
}
Oviously without nginx server running we can't access anything from an admin point, niether can we use the PCX app, any help would be appreciated.
The error log is as follows:
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in C:\Program Files\3CX Phone System\Bin\nginx/conf/nginx.conf:47
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in C:\Program Files\3CX Phone System\Bin\nginx/conf/nginx.conf:48
nginx: [warn] "ssl_stapling" ignored, no OCSP responder URL in the certificate "C:/ProgramData/3CX/Bin/nginx/conf/Instance1/domain_cert_********.3cx.uk.pem"
nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
Our actual nginx config file contains:
worker_processes auto;
events {
accept_mutex on;
worker_connections 10240;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' $http_connection;
}
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
limit_conn_zone $server_name zone=servers:10m;
geo $is_remote {
default 1;
192.168.0.0/16 0;
172.16.0.0/12 0;
10.0.0.0/8 0;
127.0.0.1 0;
}
upstream gateway {
server 127.0.0.1:5008;
keepalive 100;
}
upstream mc {
server 127.0.0.1:5004;
keepalive 100;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
listen 80;
listen [::]:80;
server_name ********.3cx.uk;
server_tokens off;
access_log off;
error_log nul crit;
if ($scheme = 'http'){
set $block_remote "1";
}
if ($is_remote){
set $block_remote "${block_remote}+1";
}
if ($block_remote = "1+1"){
return 403;
}
ssl_session_cache shared:SSL:60m;
ssl_session_timeout 1d;
ssl_stapling on;
ssl_stapling_verify on;
ssl_certificate "C:/ProgramData/3CX/Bin/nginx/conf/Instance1/domain_cert_********.3cx.uk.pem";
ssl_certificate_key "C:/ProgramData/3CX/Bin/nginx/conf/Instance1/domain_key_********.3cx.uk.pem";
ssl_prefer_server_ciphers on;
client_max_body_size 300m;
root "C:/ProgramData/3CX/Data/Http/wwwroot/webclient";
location ~ ^/webclient(?!(/api|/3cx-worker.js)) {
set $new_request_uri $request_uri;
if ($request_uri ~ ^/webclient(.*)$) {
set $new_request_uri $1;
}
return 302 $scheme://$server_name:$server_port$new_request_uri;
}
location /manager {
return 403;
}
location ~ ^/swagger {
include "mc.conf";
add_header X-Frame-Options "DENY";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "0";
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline'; img-src 'self' data:;";
add_header Strict-Transport-Security max-age=31536000;
}
location ~ ^/join/|^/meet/|^/open/|^/router|^/webmeeting|^/gateway {
# Limit of files is 4096 so we leave +1000 for system files here
limit_conn servers 2500;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1;mode=block";
add_header Content-Security-Policy "default-src 'self' *.3cx.net; style-src 'self' 'unsafe-inline' *.3cx.net; script-src 'self' 'unsafe-eval' *.3cx.net youtube.com www.youtube.com; worker-src blob:; frame-src 'self' www.youtube.com tcxwmrc:; connect-src *; img-src * data:;object-src 'none';";
add_header Strict-Transport-Security max-age=31536000 always;
add_header Referrer-Policy no-referrer;
add_header Cross-Origin-Opener-Policy same-origin;
add_header Permissions-Policy "geolocation=(),accelerometer=(),gamepad=(),magnetometer=(),midi=(),payment=(),serial=(),xr-spatial-tracking=()";
add_header Cross-Origin-Embedder-Policy credentialless;
add_header Cache-Control "no-store";
add_header Pragma "no-cache";
proxy_pass http://gateway;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~ ^/callus\.js|-worker\.js$|manifest\.webmanifest$|ngsw\.json$|index\.html$ {
include "shared-headers.conf";
add_header Cache-Control "no-cache";
add_header Pragma "no-cache";
add_header Permissions-Policy "geolocation=(),accelerometer=(),gamepad=(),magnetometer=(),midi=(),payment=(),serial=(),xr-spatial-tracking=()";
try_files $uri $uri/ @proxy;
}
location / {
include "shared-headers.conf";
add_header Cache-Control "public, immutable, max-age=31536000";
index index.html;
try_files $uri $uri/ @proxy;
}
location /user_images {
include "shared-headers.conf";
add_header Cache-Control "public, immutable, max-age=31536000";
root "C:/ProgramData/3CX/Data/Http/wwwroot";
try_files $uri $uri/;
}
location /MyPhone {
include "shared-headers.conf";
alias "C:/ProgramData/3CX/Instance1/Data/Http/Interface/MyPhone";
try_files $uri $uri/ @proxy;
}
location ~ ^(/xapi/v1/Report|/xapi/v1/ChatHistory|/xapi/v1/ChatMessages|/xapi/v1/InstallUpdates|/xapi/v1/Users/Pbx\.InstallFirmware|/xapi/v1/Users/Import) {
include "shared-headers.conf";
include "mc.conf";
proxy_read_timeout 1h;
}
location /xapi/v1/Firmwares {
include "shared-headers.conf";
include "mc.conf";
client_max_body_size 1G;
}
location @proxy {
include "shared-headers.conf";
include "mc.conf";
}
include "snippets/*.conf";
}
}
Oviously without nginx server running we can't access anything from an admin point, niether can we use the PCX app, any help would be appreciated.