-
-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server config for Nginx #373
Comments
@clemenslermen please provide your |
The nginx.conf is nearly untouched, but i've got this for regular http/https in my available site. I added
|
I found this on the Slim help forum (please note that UserFrosting is built on top of Slim, which might be helpful: http://help.slimframework.com/discussions/show-and-tell/209-sample-nginx-config |
unless php has been defined as a proxy, or group of proxies, this is your problem. you must pass the request to php, so this is either a file descriptor socket ie, another possible problem is the |
Hi guys, thx for your help so far. |
I am affected by the same issue i.e. upon installation I get 404 with "/public/install/?" |
@klearvue Are you using nginx, apache, or iis? |
@alexweissman , nginx with the following config:
|
Alright, I don't know too much about nginx, but hopefully someone will come along (perhaps @r3wt) who can help. You could try the sample config file here: http://help.slimframework.com/discussions/show-and-tell/209-sample-nginx-config and see if that works. |
Actually tried this... without success. |
So, are you guys both still stuck? Are there any errors in the php error log, or Nginx's log? |
Having the same issue, after copying userfrosting to my web folder I got to: Which resolves to: This throws a 404 error: No errors in nginx or php error logs. I suspect php-fpm isn't error reporting as you would expect some 404s but perhaps not, not sure. There is also a table in my database called "uf_configuration" so i believe the configuration of userfrosting is correct. Perplexed. Anyone with insight on this? Thanks! |
@crabstance you tried the suggested nginx config file? |
Yes, but now I can't connect at all. I'm not sure exactly what's happening in the example file, for one, what is cannon? Is that simply the folder name the user was using in his web project? What about api? what's supposed to be in that folder? At any rate still no luck. here's my config
Thanks for the help! |
Okay, I understand now. I don't need those extra location declarations. I have duplicated the php block and replaced the paths to my own web folder but still getting a 404.
|
Alright, I'll try to set up nginx at some point and see if I can't get this figured out myself. |
Maybe it's something with the .htaccess since nginx don't use apache On Fri, Aug 28, 2015, 8:46 PM Alex Weissman [email protected]
|
I can only help those who are willing to help their selves. You must understand NGINX fully. it is not a webserver you can just copy and paste codes together in the config file and it will work hunky dorey. you must understand what you are doing. Now the key part about any webserver is that it needs to have a location block for fastcgi requests, here's what mine looks like:
now, we have defined a way to pass files ending in short answer:
Now to iterate, this is a bare minimum server block for nginx + slim applications, such as userfrosting.:
Note, my example uses HHVM: change the line |
Here's an minimal example with SSL for good performance and reasonable 90/100 Qualsys score security.
|
@r3wt thanks, but please be more polite and professional. |
So I'm fairly sure the url rewrite rules are the issue. I've tried using htaccess conversion tools online but all 3 available render different results so I'm not exactly confident about them. After reading a bunch I think using conditionals in the nginx conf file should at least work so i tried that and I can load nginx successfully with most of the rewrite declarations from the original user frosting htaccess. Now when I attempt to navigate to /userfrosting/public I don't get even a 404 but simply my default document which i think is the reault of the uri not resolving to 404 but that isn't a big deal and I can figure that out later. Right now I am still at the point of trying to figure out if UF will even run on nginx. my configuration file (note I commented out the calls that prevent nginx from loading):
So basically as I understand it, the nginx configuration is incorrect meaning the requests are never properly processed or passed to any scripts. However when I attempt to use the rewrite rules, some of them keep nginx from loading and I am also getting different results when attempting to convert the re-write rules using online tools so if anyone has a tool they know and trust that would be helpful as well. I'm doing this for educational purposes so sorry if I seem a bit lost. I would really love to get this resolved so that there is at least a working example of UF running on nginx I know I will find it useful. |
Well, I'll start with your config file and see what I can do from there. The question you should be asking isn't whether UF can run on nginx, but whether Slim can run on nginx. A lot of people seem to forget or ignore the fact that UF is built on top of Slim, and it is Slim that handles all of the routing. I don't see any reason why it shouldn't be possible, though. Have you tried the Slim help forums? |
Good point actually, i will take a deeper look at the docs on slim, thanks! On Mon, Aug 31, 2015 at 12:21 PM, Alex Weissman [email protected]
|
@crabstance could you list out each rewrite rule, and explain what it is supposed to accomplish? also, have you tried:
|
Hey, @alexweissman thanks for creating the project. There should be more simple user system starters out there. I have been trying to deploy my project to my nginx server today and saw this post still open. The following, I can confirm, has got your project working with a lemp stack for me...Obviously it will probably need tweaking for anyone else and I probably won't be able to relate very well to others as my server has a lot going on and I am no nginx expert. But hopefully it can kickstart others if this is still an issue. You will need to replace the listen,allow and host variables if you need them, obviously.
|
@rez I've successfully managed to use a version of your configuration (modified for PHP 7) on our new demo server, and it's working great! Thanks so much - I will add this to the repo on the next hotfix. |
At long last, I've finally added a working nginx config file in c16825d. It's powering our demo server on Ubuntu with UF4! It should work with UF3 as well. |
Hi guys,
sorry if this is the wrong place. I already googled a lot but can't get userfrosting running on nginx. Also I read that a lot of you guys a using nginx. Is there some sort of default rule I need to copy into location?
Tried now several things - but screen stays blank during install also everything seems to be in correct place and served correctly.
The text was updated successfully, but these errors were encountered: