M
M
Maxim Grechushnikov2014-09-10 14:27:13
Nginx
Maxim Grechushnikov, 2014-09-10 14:27:13

nginx-boilerplate. How to setup pretty urls for CMS MadeSimple?

I use https://github.com/Umkus/nginx-boilerplate
For the CNC to work, you need to configure the rewrite mod. But I have nGinx + php5-fpm configured
Please help me set up the CNC
What should work: wiki.cmsmadesimple.fr/wiki/Pretty_Url

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule XXX_regex index.php?page=$1 [QSA]

My nginx settings
listen                  80;

#listen                  443 ssl;
#include                 nginx-bp/enable/ssl.conf;
#ssl_certificate         /etc/nginx/certs/server.crt;
#ssl_certificate_key     /etc/nginx/certs/server.key;

# Allow uploads?
client_max_body_size    5M;

# Gzip compression?
include                 nginx-bp/enable/gzip.conf;
gzip_comp_level         9;

# Protect system files?
include                 nginx-bp/locations/system.conf;

# Restricted access?
#allow   127.0.0.1;
#deny    all;

location @php
{
    # PHP enabled?
    include                 nginx-bp/enable/php.conf;


    # Use this instead if Php is off
    #return 405;

    #Php caching
    #include                nginx-bp/enable/php_cache.conf;
    fastcgi_cache_valid    200 301 302 304 1h;
    fastcgi_cache_min_uses 3;

    #Php request limiting?
    #limit_req               zone=reqPerSec30 burst=1000 nodelay;
    #limit_conn              conPerIp 30;
}

location ~ ^.+\.php(?:/.*)?$
{
    try_files !noop! @php;
}

# Use custom error pages?
#fastcgi_intercept_errors   on;
#include                nginx-bp/locations/errors.conf;
#error_page             404 /404.html;
#error_page             500 501 502 503 504 /50x.html;

# Allowed methods
if ($request_method !~ ^(OPTIONS|GET|HEAD|POST)$ ) {
    return              405;
}

# Log bots?
access_log              /var/log/nginx/locahost.bots.log main if=$bot_ua;

# Log humans?
access_log              /var/log/nginx/locahost.access.log main if=!$bot_ua;

# Error logging
error_log               /var/log/nginx/locahost.error.log error;

# Static requests limiting
#limit_req               zone=reqPerSec30 burst=1000 nodelay;
#limit_conn              conPerIp 30;

# Seconds to wait for backend to generate a page
fastcgi_read_timeout    1024;

# Default location /
include                 nginx-bp/locations/default.conf;

# Handle static files
include                 nginx-bp/locations/static.conf;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Grechushnikov, 2014-09-10
@maxyc_webber

Fixed it.
Disable

# Default location /
include                 nginx-bp/locations/default.conf;

Adding
location /{
        try_files $uri $uri/ /index.php?page=$request_uri;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question