Jump to content

nginx rules for IPS v4


bwx

Recommended Posts

Here's the part to handle the URLs:

    # / location block
    location / {
       index index.php;

        # IPB rewrite
        try_files $uri $uri/ /index.php?$is_args$args;

        # redirect server error pages to the static page /50x.html
        # (not sure this is still needed)
        error_page   500 502 503 504  /error.html;
    }

You may also want some other tweaks, like lettings browsers cache static content, and blocking dotfiles.

    # set expires header for static content and do not log
    location ~* \.(?:ico|css|js|gif|jpeg|jpg|png)$ {
        expires 30d;
        add_header Cache-Control "public";
        add_header Vary Accept-Encoding;
        access_log off;
    }
    
    # block access to all .files
    location ~ /\. {
        deny all;
    }

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...