GithubHelp home page GithubHelp logo

Error 500 about htmly HOT 12 CLOSED

danpros avatar danpros commented on May 18, 2024
Error 500

from htmly.

Comments (12)

oldgalileo avatar oldgalileo commented on May 18, 2024

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.

danpros avatar danpros commented on May 18, 2024

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.

oldgalileo avatar oldgalileo commented on May 18, 2024

I will try it again, but it did not appear to work last time. Also, I am running on Ubuntu Server.

from htmly.

oldgalileo avatar oldgalileo commented on May 18, 2024

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.

ncang avatar ncang commented on May 18, 2024

it's run on localhost ?

from htmly.

oldgalileo avatar oldgalileo commented on May 18, 2024

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.

ncang avatar ncang commented on May 18, 2024

i mean, make sure webserver (nginx) work in your localhost, & try htmly run well on locahost before pointing to domain,

from htmly.

oldgalileo avatar oldgalileo commented on May 18, 2024

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.

ncang avatar ncang commented on May 18, 2024

try clear browser cache, or restart nginx 💨 , sorry if it does not help

from htmly.

oldgalileo avatar oldgalileo commented on May 18, 2024

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.

oldgalileo avatar oldgalileo commented on May 18, 2024

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.

fahmi182 avatar fahmi182 commented on May 18, 2024

Congratulation ! @HowardStark :)

from htmly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.