Author Topic: nginx fails  (Read 13832 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
nginx fails
« on: March 10, 2018, 06:20:35 PM »
Good day everybody

I am just having a issue when I apache setting and then on Select WebServer when I select nginx
I get this error:
Nginx ERROR Detected ! nginx: [emerg] invalid port in upstream "123.123.123.123:PROXYPORT" in /etc/nginx/conf.d/server1.domain.com_ssl.conf:31 nginx: configuration file /etc/nginx/nginx.conf test failed

I googled for a bit and cant really see what the problem is
Here is my /etc/nginx/conf.d/server1.domain.com_ssl.conf file

Code: [Select]
# Virtual host file starts here

server {
listen 123.123.123.123:443;
access_log /var/log/nginx/access.domain.com.log;
error_log /var/log/nginx/error.domain.com.log;
server_name domain.com www.domain.com;
root /home/domain/public_html;

ssl                  on;
ssl_certificate      /etc/pki/tls/certs/domain.com.bundle;
ssl_certificate_key  /etc/pki/tls/private/domain.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
ssl_prefer_server_ciphers   on;

ssl_session_cache   shared:SSL:20m;
ssl_session_timeout 60m;

add_header Strict-Transport-Security "max-age=31536000";
add_header X-Content-Type-Options nosniff;

location / {
location ~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso|woff|ttf|svg|eot|sh)\$ {
expires 7d; #Comment this out if you are using the apache backend cache-control/expires headers.
try_files \$uri \@backend;
}
error_page 405 = \@backend;
error_page 500 = \@custom;
add_header X-Cache "HIT from Backend";
proxy_pass http://123.123.123.123:82;
include proxy.inc;
}
location \@backend {
internal;
proxy_pass http://123.123.123.123:82;
include proxy.inc;
}
location \@custom {
internal;
proxy_pass http://123.123.123.123:82;
include proxy.inc;
}
location ~ .*\.(php|jsp|cgi|pl|py)?\$ {
proxy_pass http://123.123.123.123:82;
include proxy.inc;
}
location ~ /\.ht {
deny all;
}
}

# Virtual host file ends here
and /etc/nginx/nginx.conf file
Code: [Select]
# Nginx config starts here
user nobody;
worker_processes auto;
#worker_rlimit_nofile 20480;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 4096; # increase for busier servers
use epoll; # you should use epoll for Linux kernels 2.6.x
multi_accept on;
}
http {
open_file_cache max=5000 inactive=30s;
open_file_cache_valid 120s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
open_log_file_cache max=1024 inactive=30s min_uses=2;
server_names_hash_max_size 10240;
server_names_hash_bucket_size 1024;
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 20;
gzip on;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
gzip_proxied any;
gzip_http_version 1.1;
gzip_min_length 1000;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_types text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon image/gif image/jpeg application/xml+rss text/javascript application/atom+xml application/javascript application/json;
ignore_invalid_headers on;
client_header_timeout 3m;
client_body_timeout 3m;
client_max_body_size 200m;
send_timeout 3m;
connection_pool_size 256;
client_header_buffer_size 4k;
large_client_header_buffers 4 32k;
request_pool_size 4k;
output_buffers 4 32k;
postpone_output 1460;
proxy_temp_path /tmp/nginx_temp;
log_format bytes_log "$msec $bytes_sent .";
# Include site configurations
include /etc/nginx/conf.d/*.conf;
}

Offline
*
Re: nginx fails
« Reply #1 on: March 12, 2018, 11:29:00 AM »
I have cwpPRO and the same problem

Offline
**
Re: nginx fails
« Reply #2 on: March 12, 2018, 04:27:46 PM »
Hi

It looks like you're trying to use Nginx as the primary web server , however its installed as a reverse proxy with Apache as the web server.

Offline
*
Re: nginx fails
« Reply #3 on: March 14, 2018, 11:12:21 AM »
I do not try to use ngix as main webserver. I use standard option from CWP which set up ngix as reverse proxy.
« Last Edit: March 14, 2018, 11:19:16 AM by cwp »

Offline
*
Re: nginx fails
« Reply #4 on: March 16, 2018, 11:58:40 AM »
The same thing happened to us yesterday.  Had to switch to straight Apache to get things temp running.

Offline
**
Re: nginx fails
« Reply #5 on: March 16, 2018, 01:32:21 PM »
Iv actually had some funny things happening with Varnish recently but looks like its nginx so ill be sorting that out later tonight im thinking it may be related

Offline
*
Re: nginx fails
« Reply #6 on: April 13, 2018, 08:01:43 PM »
The problem is related to SSL.
If you are not using SSL on your server, nginx works fine. If you are using SSL then it can't find the SSL port.
I contacted support and they said they will look at it (I hope).

Offline
*
Re: nginx fails
« Reply #7 on: April 16, 2018, 08:26:53 AM »
set your hostname with ssl and you should be ready to go, after switching server again to nginx

Make sure your hostname has A record and then save it again to generate AutoSSL certificates and then switch the server to apache and then back to nginx.
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Offline
*
Re: nginx fails
« Reply #8 on: May 02, 2018, 02:43:57 AM »
I just installed CentOS Web Panel into my VPS with latest version of CentOS 7.
Unfortunately, I also facing same problem when I try to use nginx as my primary web server.
 :'(