ptpb / pb

pb is a formerly-lightweight pastebin and url shortener
Other
549 stars 52 forks source link

pb doesn't work behind nginx #183

Closed amosbird closed 7 years ago

amosbird commented 7 years ago

nginx config,

location /pastebin {
        client_max_body_size 100m;
        proxy_pass http://[::]:10002/;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto https;
}

error message of pbpst -Sf foo.log -P .....

pbpst: '[' or '{' expected near '<': 1,1
amosbird commented 7 years ago

nginx version: nginx/1.10.1 pb version: git hash 29f64b08067a9e31865055e336fbe32fd1e61ebf1

buhman commented 7 years ago

< at 1,1 sounds like pbpst is being fed html, while it probably expects json.

Could you reproduce this request with curl or similar, and provide the verbatim output (from nginx I guess)? You could also look at your nginx access/error logs to see if you're getting some 400 code from nginx.

amosbird commented 7 years ago

@buhman thanks. I fixed this by using nginx subdomain instead of subdir proxy :smiley:

buhman commented 7 years ago

Ah, yeah, it's possible that was also a 404 (route does not exist) message from flask.