The configuration correct of the file nginx.conf if I have this configuration in the file .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
32 Replies
Project ID:
N/A
.htaccess is an Apache thing, it has nothing to do with nginx
you'll have to translate the rules in your .htaccess file into configurations in the nginx.config file
how this configuration would look like?
correct me if I'm wrong, is your htaccess is configuring all requests to be redirected to the index.php file?
yes, exactly
but I don't know how to configure it in nginx.conf
that's plenty easy to do in an nginx.config file, use this config file as a base in your project
https://github.com/railwayapp/nixpacks/blob/main/src/providers/php/nginx.template.conf
and then Google for the correct modifications since I don't know it off the top of my head lol
if you give it your best try and still are having troubles, I will make the modifications for you, but I'd like to see you try first, since that's how you learn 🙂
I'm trying
awesome, give it your best shot!
I have error in the concole of Railway nginx: [emerg] directive "include" is not terminated by ";" in /app/nginx.conf:11
I am deploy app codeigniter
line endings need to end with
;
It is my configuration
what's the name of that file
what file ngnix.conf or the index.php?
that config file needs to be named nginx.template.config
translate this RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
it doesn't look like you've tried anything tbh, but sure I will
please
I need to see your repo though
the repo of github?
yep!
GitHub
GitHub - MoisesCamacho01/production-aylin
Contribute to MoisesCamacho01/production-aylin development by creating an account on GitHub.
i dont see an nginx template config file?
refresh please
i dont see a
nginx.template.conf
^
ready
refresh please
cool, now all of your website code needs to live in an app folder
please make that happen
I create an app folder and place everything except the nginx file?
no, just the websites files
all these files are in the application folder
there's an index.php at the root of the project though
and other folders in the root with other web files