Comments (12)
Okay. So I fiddled with it a bit more. It seems that when I change the configuration to this:
server {
listen 80; # We're deliberately leaving this as-is to avoid conflict at the moment
root /var/www;
server_name example.com;
location / {
try_files $uri/ $uri /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
deny all;
}
location ~/\.ht {
deny all;
}
}
The things like /login and stuff work great. However going to simply example.com/ and gives me a 403. However reverting back to the previous one fixes it and reverses it. Going to example.com/index does work however. Gah.
from htmly.
Did you use the example Nginx config? I try using it and work fine, CentOS+Nginx.
server {
listen 80;
server_name example.com www.example.com;
root /usr/share/nginx/html;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log error;
index index.php;
location ~ /config/ {
deny all;
}
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
from htmly.
I will try it again, but it did not appear to work last time. Also, I am running on Ubuntu Server.
from htmly.
Nope. Still a 403 when I go to example.com and a success when I go to example.com/index. Any other ideas?
EDIT: Wait. Actually, it's a 502 for example.com/index. Interesting.
EDIT 2: I can confirm it is not an issue with php5-fpm. I tested that and it just made things worse.
from htmly.
it's run on localhost ?
from htmly.
Um. Yeah, I think so. I mean, I have a domain pointing to it, but yes. It is running on localhost I am pretty sure. How would I check?
EDIT: If you mean on my personal machine, no. I am running on a VPS.
from htmly.
i mean, make sure webserver (nginx) work in your localhost, & try htmly run well on locahost before pointing to domain,
from htmly.
I would, but the testing environment wouldn't be the same. I am running Mac OS X and don't really have an option to install refit or whatever it is called.
from htmly.
try clear browser cache, or restart nginx 💨 , sorry if it does not help
from htmly.
Sadly, I have tried both of those. If anyone else wants to chime on on successes with HTMLy and nginx, by all means.
from htmly.
Ahah! Okay. I have figured it out and you should definitely add this to the README.
Here is the config that worked:
server {
listen 80;
server_name mc.snowcraft.in;
root /var/www;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log error;
index index.php;
location ~ /config/ {
deny all;
}
location / {
try_files $uri $uri/ /index.php;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
And that works with everything. The other thing is that you have to make sure that php5-fpm was set up properly. My issue was that it was running on the sock, while I was telling it to listen on 127.0.0.1:9000. The two need to be the same in both files, and for me, the IP based one didn't work at all. So yeah. Wooo! It works!
from htmly.
Congratulation ! @HowardStark :)
from htmly.
Related Issues (20)
- Batch upload... HOT 3
- updating to new version HOT 4
- Not is possible delete static pages, categories HOT 2
- /admin/update page not working on v2.9.7 (not showing v2.9.8 update) HOT 2
- VK.COM HOT 3
- Spoiler HOT 4
- metatags HOT 3
- H4 tags capitalized HOT 5
- example.com/feed/rss HOT 2
- SEO standard invalid of META tags - Inside BODY tag HOT 1
- Support isso comment system HOT 1
- Possible to add custom HTML and/or JavaScript HOT 2
- Commentics HOT 10
- Enhancement Req : Every SAVE button shoud have ClearCache together HOT 1
- new Install white page no theme HOT 7
- HTMLy is not installed! HOT 3
- How to add custom social buttons? (Independent Publisher theme) HOT 2
- Adding sub-categories HOT 3
- What is the safe way to disable all navigation menu items? (Grid Zone Theme) HOT 3
- How to customize the sidebar (Grid Zone Theme) 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 htmly.