isso-comments / isso

a Disqus alternative
https://isso-comments.de
MIT License
5.03k stars 440 forks source link

404 error. #99

Closed ziweizhou closed 10 years ago

ziweizhou commented 10 years ago

hi.

i setup isso to use uwsgi, for some reason I am getting 404 error when I trying to access the js folder and any other folders.

the nginx config for it looks like following

upstream isso{
  server unix:///tmp/isso.sock; # for a file socket
}

server {
  server_name comment.test.com;
  location / {
    include uwsgi_params;
    uwsgi_pass isso;
  }
}

and uwsgi.ini file looks like

[uwsgi]
chdir = /sites/.virtualenvs/test/lib/python2.7/site-packages/isso
socket = /tmp/isso.sock
master = true
; set to `nproc`
threads = 4
cache2 = name=hash,items=1024,blocksize=32
; you may change this
spooler = /tmp/isso/mail
module = isso.run
; uncomment if you use a virtual environment
virtualenv = /sites/.virtualenvs/test
env = ISSO_SETTINGS=/sites/conf/isso.cfg

logto = /tmp/isso.log
uid = ubuntu
gid = ubuntu
# ... with appropriate permissions - may be needed
chmod-socket    = 666
# clear environment on exit
;vacuum          = true

Did I do anything wrong? Thanks

posativ commented 10 years ago

Looks good to me. Did you install the PyPi release or cloned the GitHub repository? If the latter, you need to build the JavaScript [1]. chdir is not necessary (but shouldn't do anything there).

[1] http://posativ.org/isso/docs/install/#install-from-source

ziweizhou commented 10 years ago

thanks for getting back to me so quickly. I am not sure if it is necessary, in order for the JS directory to work with nginx. I had to add following

location ~* ^.+\.(html|js|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|eot|ttf|woff|svg)$
  {
    root /sites/.virtualenvs/test/lib/python2.7/site-packages/isso;
    expires 30d;
    error_page 405 = $uri;
    add_header Access-Control-Allow-Origin *;
  }
posativ commented 10 years ago

Isso can also serve static assets, but this works, too. Can you confirm that Isso is responding to API requests, e.g. http://comments.server.tld/info?

ziweizhou commented 10 years ago

Yes, it does response to info and other api calls okay. I don’t know if it is because of uwsgi configuration?

Ziwei Zhou Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

已使用 Sparrow (http://www.sparrowmailapp.com/?sig)

在 2014年6月3日 星期二,下午5:14,Martin Zimmermann 写道:

Isso can also serve static assets, but this works, too. Can you confirm that Isso is responding to API requests, e.g. http://comments.server.tld/info?

— Reply to this email directly or view it on GitHub (https://github.com/posativ/isso/issues/99#issuecomment-44941361).

posativ commented 10 years ago

My uWSGI configuration is similar to yours, but my nginx configuration differs:

location ^~ /isso/api {
    uwsgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
    uwsgi_param HTTP_X_SCRIPT_NAME /isso/api;
    uwsgi_pass unix:///tmp/posativ.org-isso;
    include uwsgi_params;
}
ziweizhou commented 10 years ago

okay dummy me. I figured out why. It is my own setup fault.