Nginx Issue

Hi

  1. i have a Asus Router which supplies a domain name xxxx.asuscomm.com

  2. i have enabled the port forwarding from 8081 to 8083

image

under /etc/nginx/sites-enabled. i set this file called openhab

server {
        listen 8083 default_server;
        listen [::]:8083 default_server;
 
        auth_basic      "User and Password";
        auth_basic_user_file    /etc/nginx/.htpasswd;
		
	root /var/www/html;
        index index.html index.htm index.nginx-debian.html;

		server_name _;

		location / {
						try_files $uri $uri/ =404;
						proxy_pass                            http://localhost:8080/;
						proxy_set_header Host                 $http_host;
						proxy_set_header X-Real-IP            $remote_addr;
						proxy_set_header X-Forwarded-For      $proxy_add_x_forwarded_for;
						proxy_set_header X-Forwarded-Proto    $scheme;
					}
		}
			

when opening http://xxx.asuscomm.com:8081/, i am getting the login page

image

my user is well setup, when clicking on ok

i am getting

image

if you could help, it will be really kind.

Moreover, i am trying to find a way to access outside the local network to Tail log reader hosted at http://192.168.1.110:9001/ and to graphana http://192.168.1.110:3000/

it’s currently set in this way in my sitemap Webview url=“http://192.168.1.110:9001” height=100 .

i can not access it from myopenhab

Is it possible to block some specific sitemap to some users?

SOS:sleepy:

You need to use port 8080 not 8083 because OpenHAB uses 8080 or 8443 unless you specifically tell it to use another port.

thanks for your answer

i have changed it to 8080 but the port is already in use

i have also tried to 8443, same result

i@smhpi:~ $ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
pi@smhpi:~ $ sudo systemctl restart nginx.service
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
pi@smhpi:~ $ sudo 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: failed (Result: exit-code) since Wed 2018-08-22 00:04:49 IDT; 11s ago
     Docs: man:nginx(8)
  Process: 7088 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=0/SUCCESS)
  Process: 7710 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)
  Process: 7708 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 4542 (code=exited, status=0/SUCCESS)

Aug 22 00:04:48 smhpi nginx[7710]: nginx: [emerg] bind() to [::]:8443 failed (98: Address already in use)
Aug 22 00:04:48 smhpi nginx[7710]: nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
Aug 22 00:04:48 smhpi nginx[7710]: nginx: [emerg] bind() to [::]:8443 failed (98: Address already in use)
Aug 22 00:04:49 smhpi nginx[7710]: nginx: [emerg] bind() to 0.0.0.0:8443 failed (98: Address already in use)
Aug 22 00:04:49 smhpi nginx[7710]: nginx: [emerg] bind() to [::]:8443 failed (98: Address already in use)
Aug 22 00:04:49 smhpi nginx[7710]: nginx: [emerg] still could not bind()

Try a restart of OH2 And Nginx

it do not help