Openhabian reverse proxy starting

Hello Community. I have a question about starting of nginx. Few days ago I successfully installed nginx and get reverse proxy access to Openhab server. But today I can’t connect to this server and nginx does not work. When I connect to server I see message Error 404. How can I solve this problem ? How can I ‘completely remove’ all programs that I nstalled to get reverse proxy access in order to install it again (since nginx installation) ?

You can use the command

ls -lt /var/lib/dpkg/info/

to get a list of installed packages. The latest package is on top of the list e.g.:

-rw-r--r-- 1 root root     115 Jul 27 10:14 openhab2-addons.list
-rw-r--r-- 1 root root  108895 Jul 27 10:14 openhab2.list
-rw-r--r-- 1 root root     408 Jul 26 11:55 libebook-1.2-16:armhf.list
-rw-r--r-- 1 root root     448 Jul 26 11:55 libedata-book-1.2-25:armhf.list
-rw-r--r-- 1 root root     472 Jul 26 11:55 libebook-contacts-1.2-2:armhf.list
-rw-r--r-- 1 root root     432 Jul 26 11:55 libebackend-1.2-10:armhf.list
-rw-r--r-- 1 root root     456 Jul 26 11:54 libedataserver-1.2-21:armhf.list
-rw-r--r-- 1 root root     408 Jul 26 11:54 libcamel-1.2-54:armhf.list
-rw-r--r-- 1 root root     411 Jul 26 11:54 libavutil-ffmpeg54:armhf.list
-rw-r--r-- 1 root root     417 Jul 26 11:54 libavcodec-ffmpeg56:armhf.list
-rw-r--r-- 1 root root     422 Jul 26 11:54 libavdevice-ffmpeg56:armhf.list
-rw-r--r-- 1 root root     417 Jul 26 11:54 libavfilter-ffmpeg5:armhf.list
-rw-r--r-- 1 root root     423 Jul 26 11:54 libavformat-ffmpeg56:armhf.list

This list also includes packages that were updated because of running the upgrade command.
So in case you take this list as input to delete packages make sure that you do not delete system required libraries.
Sorting by -lt will show latest installed packages on top. Using -ltr would reverse the sort order.

By adding

> /tmp/my-file.txt

ad the end of the command everything will be redirected into a file in temp directory.

Btw. did you check the nginx logfiles to check if there is a hint why 404 was returned ?
If it once worked I doubt that without any change it suddenly does not work any longer …

Thank you for your answer.

As I understand, after executing ls -lt /var/lib/dpkg/info/ I see list, where will be nginx package (full name with version num?), and then using command purge I can delete nginx.
Am I correct ?

Btw. did you check the nginx logfiles to check if there is a hint why 404 was returned ?

  • No, I didn’t check that. But when I changed port in nginx setup file to other (for instance to 472) all work again, and I connect to Openhab server via reverse proxy (port 472). Maybe there is some “port access conflict” in my local network. What do you think about it ?

yes, the list contains name and version number and sometimes include architecture name in package name. Correct, you can use purge as an option with apt or aptitude to delete a package including the related config files.

In case the port of nginx already would be in by an other application then nginx could not be started resp. starting nginx service would return an error message.