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)
- Try to add a "center" option for images in the markdown editor HOT 2
- Confusion about static.html.php HOT 6
- code behind 404-search.html.php re-direction HOT 4
- (https://www.ascii-code.com/CP1252/191) "inverted question mark" automagically-added to each line of [post].md HOT 33
- Two blogs in one installation - is this possible? HOT 5
- Proposal to allow some static pages to be "wide" HOT 9
- What's in HTMLy 3.0? HOT 4
- Custom layout update not used for anonymous user HOT 6
- Redirect after editing static page wrong? HOT 3
- Recovering unsaved "drafts" HOT 5
- Seeking hints to input type="submit" name="updatepost" reference in /views/edit-content.html.php HOT 4
- Upgraded HTMLy shows dates in strange format HOT 4
- [Feature Request] Add links and images directly in the post editor, not via a reference at the bottom HOT 6
- WEBP image support - upload.php HOT 2
- Modify admin login path HOT 2
- php-mbstring required for 2.9.x HOT 2
- for better SEO - Meta tags are no need CLOSE SLASHES for meta and link elements HOT 1
- <meta charset="utf8"> prepended to menu() HOT 2
- Admin - Clear Cache - Not working [V2.9.6 & V2.9.7] HOT 8
- Batch upload... HOT 3
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.