nginx.conf 1.74 KB
Newer Older
Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
worker_processes auto;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;

    keepalive_timeout  65;

    set_real_ip_from  10.0.0.0/8;
    set_real_ip_from  172.16.0.0/12;
    set_real_ip_from  192.168.0.0/16;
    real_ip_header    X-Real-IP;

    upstream php-handler {
        server app-back:9000;
    }

    server {
        listen 80;

38
        root /var/www/html;
Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
39
40
41
42
43
44
45
46
47
48
49
50

        index index.php index.html index.htm;

        client_max_body_size 1G;
        fastcgi_buffers 64 4K;

        gzip on;
        gzip_vary on;
        gzip_comp_level 4;
        gzip_min_length 256;
        gzip_types application/atom+xml application/javascript audio/mpeg application/rss+xml image/bmp image/png image/jpeg image/svg+xml image/x-icon text/css text/plain text/html;

51
52
53
54
55
        location ~ /(assets|media)/.*$ {
            try_files $uri =404;
        }

        location / {
Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
            fastcgi_param SCRIPT_FILENAME /castopod/public/index.php;
            include fastcgi_params;
            fastcgi_index index.php;
            fastcgi_pass php-handler;
        }

        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_param SCRIPT_FILENAME /castopod/public/$fastcgi_script_name;
            include fastcgi_params;
            fastcgi_index index.php;
            fastcgi_pass php-handler;
        }
    }

}