R
Railway•16mo ago
danimoi

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
Percy
Percy•16mo ago
Project ID: N/A
Brody
Brody•16mo ago
.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
danimoi
danimoiOP•16mo ago
how this configuration would look like?
Brody
Brody•16mo ago
correct me if I'm wrong, is your htaccess is configuring all requests to be redirected to the index.php file?
danimoi
danimoiOP•16mo ago
yes, exactly but I don't know how to configure it in nginx.conf
Brody
Brody•16mo ago
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 🙂
danimoi
danimoiOP•16mo ago
I'm trying
Brody
Brody•16mo ago
awesome, give it your best shot!
danimoi
danimoiOP•16mo ago
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
Brody
Brody•16mo ago
line endings need to end with ;
danimoi
danimoiOP•16mo ago
It is my configuration
Brody
Brody•16mo ago
what's the name of that file
danimoi
danimoiOP•16mo ago
what file ngnix.conf or the index.php?
Brody
Brody•16mo ago
that config file needs to be named nginx.template.config
danimoi
danimoiOP•16mo ago
translate this RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]
Brody
Brody•16mo ago
it doesn't look like you've tried anything tbh, but sure I will
danimoi
danimoiOP•16mo ago
please
Brody
Brody•16mo ago
I need to see your repo though
danimoi
danimoiOP•16mo ago
the repo of github?
Brody
Brody•16mo ago
yep!
danimoi
danimoiOP•16mo ago
GitHub
GitHub - MoisesCamacho01/production-aylin
Contribute to MoisesCamacho01/production-aylin development by creating an account on GitHub.
Brody
Brody•16mo ago
i dont see an nginx template config file?
danimoi
danimoiOP•16mo ago
refresh please
Brody
Brody•16mo ago
i dont see a nginx.template.conf
danimoi
danimoiOP•16mo ago
Brody
Brody•16mo ago
^
danimoi
danimoiOP•16mo ago
ready refresh please
Brody
Brody•16mo ago
cool, now all of your website code needs to live in an app folder please make that happen
danimoi
danimoiOP•16mo ago
I create an app folder and place everything except the nginx file?
Brody
Brody•16mo ago
no, just the websites files
danimoi
danimoiOP•16mo ago
all these files are in the application folder
Brody
Brody•16mo ago
there's an index.php at the root of the project though and other folders in the root with other web files
Want results from more Discord servers?
Add your server