Domo with Nginx

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Domo with Nginx

Post by thecosmicgate »

After some strange behavoir on mine domo server i want to secure this .
So followed the Nginx wiki ( http://www.domoticz.com/wiki/Secure_Nginx_Proxy_Setup )

But when i instert to nginx.conf

Code: Select all

http {
....
 client_header_buffer_size 32k;
 large_client_header_buffers 16 32k;
....
}
the service won't start anymore ?

Code: Select all

Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
nginx -t -c /etc/nginx/nginx.conf

Code: Select all

failed (13: Permission denied)
2016/07/09 10:50:55 [warn] 11020#11020: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2016/07/09 10:50:55 [emerg] 11020#11020: unknown directive "...." in /etc/nginx/nginx.conf:13
nginx: configuration file /etc/nginx/nginx.conf test failed

Insert would be like :

Code: Select all

user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
	worker_connections 768;
	# multi_accept on;
}


http {
....
 client_header_buffer_size 32k;
 large_client_header_buffers 16 32k;
....
}



	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# SSL Settings
	##

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
	ssl_prefer_server_ciphers on;

	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";

	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 6;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	##
	# Virtual Host Configs
	##

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;
}


#mail {
#	# See sample authentication script at:
#	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
# 
#	# auth_http localhost/auth.php;
#	# pop3_capabilities "TOP" "USER";
#	# imap_capabilities "IMAP4rev1" "UIDPLUS";
# 
#	server {
#		listen     localhost:110;
#		protocol   pop3;
#		proxy      on;
#	}
# 
#	server {
#		listen     localhost:143;
#		protocol   imap;
#		proxy      on;
#	}
#}

Wen deleted this everything is workingfine .
It's nice to be important, but it's more important to be nice
Scooter ;)
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Domo with Nginx

Post by thecosmicgate »

found the solution :) it's working now :

Code: Select all

systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Sam 2016-07-09 14:38:59 CEST; 1min 21s ago
  Process: 12126 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exit
  Process: 12213 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 12209 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS
 Main PID: 12215 (nginx)
   CGroup: /system.slice/nginx.service
           ├─12215 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
           ├─12216 nginx: worker process
           └─12217 nginx: worker process

Jul 09 14:38:59 Domoticz2 systemd[1]: Starting A high performance web server and a reverse proxy server...
Jul 09 14:38:59 Domoticz2 systemd[1]: Started A high performance web server and a reverse proxy server.
lines 1-14/14 (END)
the problem was the placing of the extra entries in the /etc/nginx/nginx.conf file.

Next: when i refresh the domo website i get :502 Bad Gateway
what did i do wrong here ?
It's nice to be important, but it's more important to be nice
Scooter ;)
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Domo with Nginx

Post by thecosmicgate »

Nobody who can help me I bit further?

Sent from my SM-G935F using Tapatalk
It's nice to be important, but it's more important to be nice
Scooter ;)
slvstr
Posts: 1
Joined: Sunday 30 October 2016 14:33
Target OS: Linux
Domoticz version:
Contact:

Re: Domo with Nginx

Post by slvstr »

thecosmicgate wrote:found the solution :) it's working now :

the problem was the placing of the extra entries in the /etc/nginx/nginx.conf file.
I have the same problem still. Could you tell where exactly you placed the extra entries to make it working?
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest