Forbidden Access (403)
I am trying to deploy CI4 on Railway using the Nixpact builder, everything runs smoothly, but when the domain is accessed, a 403 nginx error occurs. The error message in the log is as follows:
2023/11/01 11:03:37 [error] 23#23: *2 directory index of "/app/" is forbidden, client: 192.168.0.3, server: localhost, request: "GET / HTTP/1.1", host: "ci4nixpact-production.up.railway.app"
Please help me, thank you
11 Replies
Project ID:
78437940-50ad-4708-8953-68a5a25dffbd
78437940-50ad-4708-8953-68a5a25dffbd
can you share your repo?
@Brody sure, https://github.com/heriira/ci4_nixpact
GitHub
GitHub - heriira/ci4_nixpact
Contribute to heriira/ci4_nixpact development by creating an account on GitHub.
@aleks any ideas?
What's
nixpact.toml
?
Try setting the NIXPACKS_PHP_ROOT_DIR
environment variable to public
.
Ah, also set NIXPACKS_PHP_FALLBACK_PATH
to /index.php
.@aleks just ignore it's an exploration to solve this problem.
I have tried to add both empironments in train, and now the error displayed is file not found [attached]
Oh, sorry,
NIXPACKS_PHP_ROOT_DIR
should be /app/public
.
Did you mean to make nixpacks.toml
instead of nixpact.toml
?@aleks Yes, I tried to create that file but there was a typo when naming the file. now I have named it correctly.
I have tried changing
NIXPACKS_PHP_ROOT_DIR
to /app/public
. now the error has changed [attached]
Is there another environment I'm missing?Ah. Would it be possible for you to use
/app/storage
instead of /app/writable
for the moment? I'll PR a variable to configure that, though@aleks yes, I have tried it, and it doesn't work. Actually, I just want to deploy CI4 starter on the Railway platform. Inside this project, I haven't added anything yet. So, if you're willing, maybe you can try deploying the CodeIgniter 4 starter on Railway, and later I will follow the template you create. I really appreciate it, thank you