Support the ongoing development of Laravel.io →
posted 9 years ago
Configuration
Last updated 1 year ago.
0
Solution

Flippin' typical - bit more Googling around and I've found a solution that when applied, works perfectly.

Basically, in Forge in the site list there's a wee dropdown icon at the bottom, click it and it gives an option to 'Edit Nginx Configuration', up will pop a modal with the config details from the server.

Scroll down to the line that reads... fastcgi_split_path_info ^(.+.php)(/.+)$;

And place this line just above it... try_files $query_string /index.php =404;

I saved it, restarted the server from the server page and job done. :)

Kudos to Mr Bashy: https://laracasts.com/discuss/channels/requests/nginx-on-homes...

0

slev70 said:

Flippin' typical - bit more Googling around and I've found a solution that when applied, works perfectly.

Basically, in Forge in the site list there's a wee dropdown icon at the bottom, click it and it gives an option to 'Edit Nginx Configuration', up will pop a modal with the config details from the server.

Scroll down to the line that reads... fastcgi_split_path_info ^(.+.php)(/.+)$;

And place this line just above it... try_files $query_string /index.php =404;

I saved it, restarted the server from the server page and job done. :)

Kudos to Mr Bashy: https://laracasts.com/discuss/channels/requests/nginx-on-homes...

@slev70 this gives you a 404 page but what about launching the site? I agree btw its very hard to find a solution for this problem.

Last updated 9 years ago.
0

@slev70 Thank you jesus for posting this solution! I've got the same issue where we need to maintain exact URL matches after upgrading to Laravel (due to Adwords, not SEO), so we have to spoof the browser. I'm using Forge as the backup install of my app and could not for the life of me get the site to work on any page that ended in .php. Your solution solved the issue and there don't seem to be any side effects.

0

The way I did it for my domain (http://diydifm.com) was in Envoyer set the Project path to "/home/forge/default" (or replace "default" with the project name if specified) and in Forge set the web directory to "/current/public"

Last updated 8 years ago.
0

slev70 said:

Flippin' typical - bit more Googling around and I've found a solution that when applied, works perfectly.

Basically, in Forge in the site list there's a wee dropdown icon at the bottom, click it and it gives an option to 'Edit Nginx Configuration', up will pop a modal with the config details from the server.

Slightly faster fix:

Based on what slev70 had I navigated to the edit page for Nginx Configuration. At the top of this file is the server default settings including the default path.

I found that the default path was not pointing to the correct folder that git would publish to on the digital ocean server. By default it was pointing to:

root /home/forge/default/public;

git is publishing to /home/forge/default

changed root to the following

root /home/forge/default;

saved and did a refresh to the site and my hello world test PHP started loading without issues.

I did not need to make any additional changes.

sebastiantramper liked this reply

1

Sign in to participate in this thread!

Eventy

Your banner here too?

slev70 slev70 Joined 28 Jan 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.