Community discussions

MikroTik App
 
deanMK
newbie
Topic Author
Posts: 32
Joined: Sat Apr 12, 2014 2:46 pm
Location: Macedonia

NGINX Container returns me Forbidden 403

Sun Jul 16, 2023 6:48 pm

Hi Mikrotik

I use hAP AX3 with container package installed and working. Today installed NGINX container, and all works fine, except that on every file i got "Forbidden 403" error , no matter on permission i set on file. nginx container is working properly:
[admin@MikroTik] /container> pr
 0 name="9448b877-5ea9-4b9e-8499-2f0ab03185a4" tag="library/nginx:latest" os="linux" arch="arm64" interface=veth1 root-dir=usb1/nginx mounts=html dns="" status=running 
i have created "html" folder on my USB stick.

This is my Container configuration:
# 2023-07-16 17:43:46 by RouterOS 7.10.2
# software id = MGL0-4L4W
#
# model = C53UiG+5HPaxD2HPaxD
# serial number = XXXXXXXX
/container mounts
add dst=/usr/share/nginx/html name=html src=/usb1/html
/container
add interface=veth1 mounts=html root-dir=usb1/nginx
/container config
set registry-url=https://registry-1.docker.io tmpdir=usb1/pool
Everything seems to works, but i got Forbidden 403 on every file i upload to my usb stick. Anyone with tip how to solve this?

Files stuck on CHMOD 660 whatever i tryed to set to 755.

Image

Image
 
ConradPino
Member
Member
Posts: 337
Joined: Sat Jan 21, 2023 12:44 pm
Contact:

Re: NGINX Container returns me Forbidden 403

Mon Aug 28, 2023 7:57 am

Read RouterOS Containers § Tips and tricks Look for:
  • Enable logging to get output from container:
  • It is possible to get to running container shell:

Use the container shell to view these files:
/var/log/nginx/access.log
/var/log/nginx/error.log
 
User avatar
antosusan
just joined
Posts: 11
Joined: Mon Apr 03, 2023 7:37 am
Location: Indonesia

Re: NGINX Container returns me Forbidden 403

Fri Jan 05, 2024 5:47 am

Hi Mikrotik

I use hAP AX3 with container package installed and working. Today installed NGINX container, and all works fine, except that on every file i got "Forbidden 403" error , no matter on permission i set on file. nginx container is working properly:
[admin@MikroTik] /container> pr
 0 name="9448b877-5ea9-4b9e-8499-2f0ab03185a4" tag="library/nginx:latest" os="linux" arch="arm64" interface=veth1 root-dir=usb1/nginx mounts=html dns="" status=running 
i have created "html" folder on my USB stick.

This is my Container configuration:
# 2023-07-16 17:43:46 by RouterOS 7.10.2
# software id = MGL0-4L4W
#
# model = C53UiG+5HPaxD2HPaxD
# serial number = XXXXXXXX
/container mounts
add dst=/usr/share/nginx/html name=html src=/usb1/html
/container
add interface=veth1 mounts=html root-dir=usb1/nginx
/container config
set registry-url=https://registry-1.docker.io tmpdir=usb1/pool
Everything seems to works, but i got Forbidden 403 on every file i upload to my usb stick. Anyone with tip how to solve this?

Files stuck on CHMOD 660 whatever i tryed to set to 755.

Image

Image
i have this problem and i reinstall the container and problem is solved
 
User avatar
patrikg
Member Candidate
Member Candidate
Posts: 262
Joined: Thu Feb 07, 2013 6:38 pm
Location: Stockholm, Sweden

Re: NGINX Container returns me Forbidden 403

Fri Jan 05, 2024 10:11 am

How do you format the usb memory stick ? ext2/3/4,fat,fat32, or ntfs....

And i think you can execute the id command to get what username and usernumber trying to read write files ? From the webserver perspective.

And what i can see in your picture (at the end of the line) the user root owns the files.
May be the nginx server uses some another user, to read files.
Maybe as a workaround you can set read and write permission to the Public Permissions.
But I suggest you to investigate what user being used then using nginx container.

And what are the nginx config says where is the root ??

Who is online

Users browsing this forum: No registered users and 4 guests