Comments (13)
Nice - got it working. Problem yesterday was the # enforce NO www as I already do this before (and that I was short on time ;) ). Shortly - if you already rewrite www to non-www just use this in your server section:
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
log_not_found off;
}
# removes trailing slashes (prevents SEO duplicate content issues)
if (!-d $request_filename)
{
rewrite ^/(.+)/$ /$1 permanent;
}
# unless the request is for a valid file (image, js, css, etc.), send to bootstrap
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
... and optionally get rid of the .htaccess in public folder.
Thanks for the support!
from lychee.
No, it is totally normal that there is no php
folder or php/index.php
file.
This is taken care of by the routes in Laravel. Cf in routes/web.php:
Route::post('/php/index.php', 'SessionController@init'); // entry point if options are not initialized
To solve this, from https://www.digitalocean.com/community/tutorials/how-to-deploy-a-laravel-application-with-nginx-on-ubuntu-16-04 They just do :
location / {
try_files $uri $uri/ /index.php?$query_string;
}
However this approach might be better: https://gist.github.com/ashleydw/afd389b1e763d3c1cf1f
The part that is of interest for you:
# serve static files directly
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
log_not_found off;
}
# removes trailing slashes (prevents SEO duplicate content issues)
if (!-d $request_filename)
{
rewrite ^/(.+)/$ /$1 permanent;
}
# enforce NO www
if ($host ~* ^www\.(.*))
{
set $host_without_www $1;
rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
}
# unless the request is for a valid file (image, js, css, etc.), send to bootstrap
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
If you get something to work please do tell us as we don't use nginx and that would be useful for other users.
from lychee.
Thanks for your proposals. Just gave it a quick try but neither of the two proposals seem to work (first solution made no difference, second gave me a 502 Bad Gateway). I will take a look at how to integrate laravel in the nginx environment and have some experiments tomorrow and let you know my progress.
from lychee.
The 502 Bad Gateway is actually a good news! It means that the problem is not with the rewrite anymore but with the server parameters.
from lychee.
@Hagenzone Can you write a page in the Wiki to descripe how to install Lychee-Laravel on nginx ? :)
from lychee.
Sure. Could you grant me access?
from lychee.
@Hagenzone sorry, I though you already had access. Fixed. :)
from lychee.
Does this take a while to apply? Still can't push :(
from lychee.
That is surprising because I untick the box as required:
- Restrict editing to users in teams with push access only
Public wikis will still be readable by everyone.
from lychee.
Tried to edit wiki page locally and push. Resulted in 403. Updated the page via github GUI now.
from lychee.
@Hagenzone I saw your edit. It's perfect. Can we close this issue ? :)
from lychee.
Sure, thanks again!
from lychee.
Tried to edit wiki page locally and push. Resulted in 403. Updated the page via github GUI now.
If you got the URL while you didn't have access it would have defaulted to anonymous https. That may have been the issue here.
Thanks for the work. That'll come in really useful for me very shortly!
from lychee.
Related Issues (20)
- Directories with '[' symbols cannot be imported
- Cannot upload images HOT 3
- Share Button does not get disabled using share_button_visible 1/0
- Image selecting does not work on chrome + MacOS HOT 4
- HTTP Exception 500: "CC-BY" is not a valid backing value for enum App\Enum\LicenseType (View: /var/www/html/Lychee/resources/views/livewire/pages/gallery/album.blade.php) HOT 1
- Missing tools on desktop browser
- Overflow in the details panel HOT 1
- [5.2.0] Maps on image detail is not updated when switching left right.
- #2392 recurring in Lychee 5.2.2 ("CC-BY-SA" is not a valid backing value for enum) HOT 1
- If you can read me, it means that you misconfigured Lychee. HOT 6
- Inverted date on album tiles with multiple months HOT 1
- [5.3.0] Clean installation without error but image is not showing... again HOT 1
- `additional_footer_text` not displayed
- Can not move photos into album containing apostrophe in title
- File-Suffixes duplicated in Downloaded Album HOT 2
- Sharing - Select all users HOT 1
- Could not Upload Photos HOT 2
- Laravel/Eloquent query builder failed when viewing Tag Album contents HOT 1
- Inverted date on album tiles with multiple months HOT 3
- Error in german translation for "GALLERY" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lychee.