Problem getting Nginx started on Raspbian
I have a Raspberry Pi running as the Bind server and Nginx server (reverse proxy) on our home LAN. Version: "Raspbian GNU/Linux 9 (stretch)"
Upon booting, Nginx will not start. I've enabled it using systemctl and after rebooting Nginx's error log contains: Code:
[emerg] 798#798: host not found in upstream "testhost.internal-domain:80" in /etc/nginx/sites-enabled/testhost.internal-domain.conf:5 By the time I can get logged in and verify that Nginx is not running, manually executing "/etc/init.d/nginx start" works as it should. The service file in /lib/systemd/system contains: Code:
Description=A high performance web server and a reverse proxy server Code:
Description=A high performance web server and a reverse proxy server I commented out the "After=network.target" record since it seemed logical it seemed logical that, if bind waited for network.target, nginx could simply wait for bind. After running "systemctl daemon-reload" and booting, though, the same result. Same error message in Nginx's error log. Systemd shows that the nginx service is enabled. /var/log/syslog contains the error messages: Code:
nginx[819]: nginx: [emerg] bind() to 192.168.13.178:80 failed (99: Cannot assign requested address) At this point, I've restored the service file using the pre-tweak backup file. Summary: At boot: Starting it within Systemd? Does not start nginx. After boot: "system nginx start"? Starts nginx After boot: "systemctl start nginx.service"? Starts nginx ... and everything seems to be working after issuing any of the manual commands. (Accessing web sites from the internet does get to the actual servers listening on 8080, etc.) Ideas as to where to look next? (I'm trying really hard to be friends with Systemd but every time I encounter a problem with it, I'm seriously tempted to search out a Systemd-free OS for the Pi.) TIA... |
Code:
nginx[819]: nginx: [emerg] bind() to 192.168.13.178:80 failed (99: Cannot assign requested address) Maybe something like the below: Code:
After=network.target bind9.service |
Quote:
Code:
[emerg] bind() to 192.168.13.178:80 failed (99: Cannot assign requested address) Aha! I realized that I had troubles getting nginx up and running last summer. The fix at that time was to alter the Unit definition to be: Code:
[Unit] I'll mark this as "solved". |
All times are GMT -5. The time now is 03:01 PM. |