I'm seeing Welcome to nginx! Is that considered successful installation?

If so, how do I reach main page? :smiley:

Hi,

@david any thoughts to resolve this?

Did you try restarting the server?
I got that same page when I did a fresh install yesterday. I restarted the server and it loaded for me

@jang430

Which installation guide are you following? You’ll need to ensure the nginx vhost is configured to point to the directory where invoice ninja is.

1 Like

Yeah :D. Stopped and started several times.

I’m using docker compose, and edited some of the lines in yml file to get this installed.

Is this information what you’re asking?

my guess is your may not be pointing to the right port. in the docker compose file, change the port to say 8000, then try and reach your installation on http://localhost:8000

You mean I change 9001 to another port such as 8000 and check?

mmm, are you sure this is the right IP address?

my nas is 192.168.1.8. I just changed it to 8001, to test, still having the same Nginx welcome screen.

I had to modify this line- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro to get it to reach what I’m seeing now, Nginx welcome screen. Should I not?

Hi David, without changing ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro, I am getting the below error.

server_1 | /docker-entrypoint.sh: Configuration complete; ready for start up
server_1 | 2022/07/21 11:15:09 [crit] 1#1: pread() “/etc/nginx/conf.d/in-vhost.conf” failed (21: Is a directory)
server_1 | nginx: [crit] pread() “/etc/nginx/conf.d/in-vhost.conf” failed (21: Is a directory)
ninja_server_1 exited with code 1

Therefore, I change it to something like ./config/nginx/in-vhost.conf:/etc/ninja/conf.d/in-vhost.conf:ro, and it allows me to reach welcome to Nginx

Hello. Anyone has ideas about this? Have been searching google, with no answer in sight for this.

@jang430 If you are seeing the welcome page for nginx, you have the right network config. Your virtual host is just not pointing to the right folder path where invoice ninja is located or if it is, the proper vhost config is not loaded and a restart of the nginx service should do it.

I’m more of an Apache person, so if you give up and want to switch, I can always lend some help.

If I don’t change the following 2 lines, I can’t get it to work.

If I leave the following as it is

  • ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro

I get [crit] 1#1: pread() “/etc/nginx/conf.d/in-vhost.conf” failed (21: Is a directory)
server_1 | nginx: [crit] pread() “/etc/nginx/conf.d/in-vhost.conf” failed (21: Is a directory)

Leaving the following line as it is

  • ./config/hosts:/etc/hosts:ro

I get ERROR: for app Cannot start service app: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:75: mounting “/share/ZFS18_DATA/Container/n1/config/hosts” to rootfs at “/etc/hosts” caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

I am stuck with these 2 lines. What should they be? Should I modify them?

@jang430 I assume you are running this in a docker container on a Synology NAS. Can you confirm your in-vhost.conf file is under ./config/nginx/ and your hosts file is under ./config/hosts ? Just making sure the volume bind is working correctly.

My setup is most likely different from yours and both of these files just sit in the IN folder as you can see on the screenshot. Mine are also hidden, hence the “.” at the front of their name.

That’s the thing, when I run the yml file, it creates a folder instead of a file.

image

@jang430

May I see the files in your config folder and config/nginx folder , and also what’s in your docker-compose.yml ?

version: ‘3.7’

services:
server:
image: nginx
restart: always
env_file: env
volumes:
# Vhost configuration
#- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com
- ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro
- ./app/public:/var/www/app/public:ro
depends_on:
- app
# Run webserver nginx on port 80
# Feel free to modify depending what port is already occupied
ports:
- “9090:80”
#- “443:443”
networks:
- invoiceninja
extra_hosts:
- "in5.localhost:192.168.0.124 " #host and ip

app:
image: invoiceninja/invoiceninja:5
env_file: env
restart: always
volumes:
#- ./config/hosts:/etc/hosts:ro
- ./docker/config/hosts:/etc/hosts:ro
- ./docker/app/public:/var/www/app/public:rw,delegated
- ./docker/app/storage:/var/www/app/storage:rw,delegated
depends_on:
- db
networks:
- invoiceninja
extra_hosts:
- "in5.localhost:192.168.0.124 " #host and ip

db:
image: mysql:5
ports:
- “3305:3306”
restart: always
env_file: env
volumes:
- ./docker/mysql/data:/var/lib/mysql:rw,delegated

networks:
  - invoiceninja
extra_hosts:
  - "in5.localhost:192.168.0.124 " #host and ip

networks:
invoiceninja:


You’ll see my config folder contains nginx and hosts. Nginx contains another in-vhost.conf folder, without content.

@jang430 Both hosts and in-vhost.conf files are supposed to be files and not folders. You, or an installer script must have created those folders and I believe that’s what’s causing the issues here.

Create a hosts file and put the IP address and hostname of your NAS in it and save it. You can save it directly in the config folder as long as the path reference is correct in the docker manifest (YML file).
Sample content for the hosts file:
192.168.1.10 hostname

You need to get a copy of the in-vhost.conf file from somewhere as there’s a whole bunch of stuff in it. I downloaded mine from a third party and happy to share it with you but I can’t guarantee it will work for you as my Invoice Ninja runs on a Synology NAS. Let me know either way and I’m happy to send it to you.

Please do send me a copy. I’ll give it a try.

Does the host file need to have any extension? Do you mean create the config folder beforehand, and have the host file in it, before running docker-compose up?

The folder n1 is originally empty, with just yml and env file. Upon running docker-compose up, that’s the only time all the other folders are created, including hosts folder and in-vhosts.conf folder.

Additional question regarding hostname inside hosts file, the host is whatever I want to call it, correct? Or my nas hostname? I don’t access my nas via hostname, instead via IP of 192.168.1.8. Should this hostname be the same as the hostname inside the yml file? Currently, hostname inside yml file is in5.localhost. Can I use hostname abc in both hosts file and inside yml file?