Skip to content

Modsecurity Ajax Error: Internal server Error #830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rz300 opened this issue Jan 20, 2015 · 4 comments
Closed

Modsecurity Ajax Error: Internal server Error #830

rz300 opened this issue Jan 20, 2015 · 4 comments

Comments

@rz300
Copy link

rz300 commented Jan 20, 2015

After installing modsec from official instructions my site doesn't work correctly. Admin side from cms is build with ajax and something else and it doesn't work.

        location / {
        ModSecurityEnabled on;
        ModSecurityConfig /etc/modsecurity/modsecurity.conf;
        testcookie off;
        root /srv/rewired.ru/www;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-for $remote_addr;
        proxy_set_header Host $host;
        proxy_pass http://rewired/;
        proxy_connect_timeout 180s;
        proxy_send_timeout 90;
        proxy_read_timeout 180s;
        proxy_set_header Connection close;
        proxy_pass_header Content-Type;
        proxy_pass_header Content-Disposition;
        proxy_pass_header Content-Length;
        proxy_cache_valid any 10m;
        proxy_buffer_size 8k;
        }

tail from nginx error.log

2015/01/20 14:21:14 [error] 13250#0: *323475 upstream prematurely closed connection while reading response header from upstream, client: 178.140.252.82, server: id-st.ru, request: "POST /admin/update/index.php HTTP/1.1", upstream: "http://127.0.0.1:8080/admin/update/index.php", host: "rewired.ru", referrer: "http://rewired.ru/admin/"
2015/01/20 14:26:52 [error] 29780#0: *4 upstream prematurely closed connection while reading response header from upstream, client: 178.140.252.82, server: id-st.ru, request: "GET /admin/ HTTP/1.1", upstream: "http://127.0.0.1:8080/admin/", host: "rewired.ru"
2015/01/20 14:26:52 [error] 29781#0: *14 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 178.140.252.82, server: id-st.ru, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "plitka-zel.ru"
2015/01/20 14:26:53 [error] 29841#0: *16 connect() failed (111: Connection refused) while connecting to upstream, client: 178.140.252.82, server: id-st.ru, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "rewired.ru"
2015/01/20 14:26:53 [error] 29844#0: *18 connect() failed (111: Connection refused) while connecting to upstream, client: 178.140.252.82, server: id-st.ru, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8080/favicon.ico", host: "plitka-zel.ru"
2015/01/20 14:27:10 [alert] 29845#0: *31 no upstream configuration, client: 178.140.252.82, server: id-st.ru, request: "POST /admin/update/index.php HTTP/1.1", host: "rewired.ru", referrer: "http://rewired.ru/admin/"
2015/01/20 14:27:42 [alert] 29782#0: *45 no upstream configuration, client: 178.140.252.82, server: id-st.ru, request: "POST /admin/xsl/index.php HTTP/1.1", host: "rewired.ru", referrer: "http://rewired.ru/admin/"

any ideas?

@zimmerle
Copy link
Contributor

Hi @rz300,

Which branch are you using? I recommend the utilization of the branch: nginx_refactoring

Check if your site became workable by setting SecRequestBodyAccess to off. More info on SecRequestBodyAccess: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#secrequestbodyaccess

@rz300
Copy link
Author

rz300 commented Jan 20, 2015

main branch, thanks it works, but if SecRequestBodyAccess is off, security of the server is going low?

@zimmerle
Copy link
Contributor

Hi @rz300 few minutes ago I've merge #904 into nginx_refactoring branch. It should fix this issue, please confirm that the issue is fixed.

@zimmerle
Copy link
Contributor

zimmerle commented May 9, 2017

No longer a concern in libModSecurity. Marking it as won't fix for 2.x. Further information about libModSecurity available here:
https://github.com/SpiderLabs/ModSecurity/tree/v3/master

@zimmerle zimmerle closed this as completed May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants