PhlexPlexico / G5V

A front-end for G5API to manage matches/seasons/tournaments for CS:GO
MIT License
56 stars 29 forks source link

[BUG] Docker Container Not Redirecting Properly #68

Closed PhlexPlexico closed 3 years ago

PhlexPlexico commented 3 years ago

There currently exists an issue in the Dockerfiles that does now allow a user to directly link to a specific part of the application. This is due to the try_files directive in the Nginx instance in the container. The quickest way to fix this would be to provide an nginx default.conf file to change the try_files $uri /index.html; under the location / block. That way a user will not have to ash into the container and make the change themselves.

kdev commented 3 years ago

Would it be enough to put this into NGINXs default.conf inside the created docker container?

PhlexPlexico commented 3 years ago

Yup! @ebuttonsdude and I were having a conversation about this a few weeks ago and honestly I think either grabbing a default.conf and plopping it in the repo and copy/pasting it with the Dockerfile could work. Alternatively, I think a sed command could work as well too, however it's a bit more complex

kdev commented 3 years ago

I would just use the COPY Docker Command to put a default.conf into the nginx directory as it is the way they show it on the official Docker Hub page of nginx

kdev commented 3 years ago

This did not fix the problem at all. I can still reproduce the error.

kdev commented 3 years ago

This seems to be an actual major bug we (mostly I) introduced

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:13:07 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:13:08 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:13:10 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:13:11 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:13:13 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:13:15 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:13:20 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:13:27 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:13:40 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2021/08/20 18:14:07 [emerg] 1#1: "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
nginx: [emerg] "user" directive is not allowed here in /etc/nginx/conf.d/default.conf:1
PhlexPlexico commented 3 years ago

Well, yes because it's not copying to the right place. I believe this file should be placed at /etc/nginx/nginx.conf

This latest commit should fix it. I think

kdev commented 3 years ago

It is still not working for me

kdev commented 3 years ago

I think this could work as a reference

PhlexPlexico commented 3 years ago

There that should fix it I think?

kdev commented 3 years ago

I think we are missing a }:

2021/08/20 19:52:59 [emerg] 1#1: unexpected end of file, expecting "}" in /etc/nginx/conf.d/default.conf:34
nginx: [emerg] unexpected end of file, expecting "}" in /etc/nginx/conf.d/default.conf:34
PhlexPlexico commented 3 years ago

My bad 😅 give it a shot now

kdev commented 3 years ago

Fixed!