C
C
Coder3212017-03-14 22:39:43
PHP
Coder321, 2017-03-14 22:39:43

How to set up sendy on nginx?

Help someone to run sendy on nginx correctly.
My config, what's wrong here?

upstream php-fpm
{
  # PHP5-FPM сервер
  server unix:/var/run/php5-fpm.sock;
}

server
{
     listen 3000; 

    root			/srv/sendy;
    index			index.php;
    server_name		_;
    autoindex off;



    access_log /srv/sendy/logs/access.log;
    error_log /srv/sendy/logs/error.log;

    location / {
        try_files $uri $uri/ $uri.php?$args;
    }

    location /l/ {
        rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last;
    }

    location /t/ {
        rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last;
    }

    location /w/ {
        rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last;
    }

    location /unsubscribe/ {
        rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last;
    }

    location /subscribe/ {
        rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
        access_log off;
        log_not_found off;
        expires 30d;
    }
}

At the entrance, it redirects to _install.php, I can’t figure out why. Maybe someone has already done this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question