mediawiki, php-fpm, and nginx

Anoop Alias anoopalias01 at gmail.com
Sun Sep 17 13:36:19 UTC 2017


Hi Etienne,

Assuming you want mediawiki to be served from /wiki/

##########################
server{

root /path/to/directory/excluding/wiki;
..
..
...
location /wiki/ {

try_files $uri $uri /wiki/index.php?query_string;

    location ~ \.php$ {

      try_files $uri =404;
      fastcgi_index index.php;
      include fastcgi_params;
      fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;

    }

}

##########################

note the ~ \.php location is inside location /wiki/ and the root directive
only come once in the server {}

Good Luck




On Sun, Sep 17, 2017 at 6:55 PM, Etienne Robillard <tkadm30 at yandex.com>
wrote:

> Hi Anoop,
>
> Not sure why, but php-fpm now returns a blank page.
>
> Here's my error_log:
>
> 2017/09/17 09:16:02 [debug] 21872#21872: epoll add event: fd:7 op:1 ev:00002001
> 2017/09/17 09:16:02 [debug] 21874#21874: epoll add event: fd:7 op:1 ev:00002001
> 2017/09/17 09:16:02 [debug] 21873#21873: epoll add event: fd:7 op:1 ev:00002001
> 2017/09/17 09:16:02 [debug] 21871#21871: epoll add event: fd:7 op:1 ev:00002001
> 2017/09/17 09:16:09 [debug] 21871#21871: accept on 0.0.0.0:80, ready: 1
> 2017/09/17 09:16:09 [debug] 21873#21873: accept on 0.0.0.0:80, ready: 1
> 2017/09/17 09:16:09 [debug] 21871#21871: accept() not ready (11: Resource temporarily unavailable)
> 2017/09/17 09:16:09 [debug] 21873#21873: posix_memalign: 0998ACC0:256 @16
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 accept: 127.0.0.1:56704 fd:4
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 event timer add: 4: 60000:2415675759
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 reusable connection: 1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 epoll add event: fd:4 op:1 ev:80002001
> 2017/09/17 09:16:09 [debug] 21873#21873: accept() not ready (11: Resource temporarily unavailable)
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http wait request handler
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 malloc: 099AEEE8:1024
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 recv: eof:0, avail:1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 recv: fd:4 134 of 1024
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 reusable connection: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 posix_memalign: 09992DB0:4096 @16
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http process request line
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http request line: "GET */wiki/* HTTP/1.1"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http uri: "*/wiki/*"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http args: ""
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http exten: ""
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http process request header line
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http header: "TE: deflate,gzip;q=0.3"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http header: "Connection: TE, close"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http header: "Host: localhost"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http header: "User-Agent: lwp-request/6.15 libwww-perl/6.15"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http header done
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 event timer del: 4: 2415675759
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 generic phase: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 rewrite phase: 1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 test location: "/pub"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 test location: "/webalizer"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 test location: "/wiki"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 test location: ~ "\.php$"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 using configuration "/wiki"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http cl:-1 max:5242880
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 rewrite phase: 3
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 post rewrite phase: 4
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 generic phase: 5
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 generic phase: 6
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 generic phase: 7
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 access phase: 8
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 access phase: 9
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 access phase: 10
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 post access phase: 11
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 content phase: 12
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 open index "/home/www/isotoperesearch.ca/wiki/index.php"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 internal redirect: "/wiki/index.php?"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 rewrite phase: 1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 test location: "/pub"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 test location: "/webalizer"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 test location: "/wiki"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 test location: ~ "\.php$"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 using configuration "\.php$"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http cl:-1 max:5242880
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 rewrite phase: 3
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 post rewrite phase: 4
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 generic phase: 5
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 generic phase: 6
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 generic phase: 7
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 access phase: 8
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 access phase: 9
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 access phase: 10
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 post access phase: 11
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http init upstream, client timer: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 epoll add event: fd:4 op:3 ev:80002005
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "PATH_INFO"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "/wiki/index.php"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "PATH_INFO: /wiki/index.php"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "QUERY_STRING"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "QUERY_STRING: "
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "REQUEST_METHOD"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "GET"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "REQUEST_METHOD: GET"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "CONTENT_TYPE"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "CONTENT_TYPE: "
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "CONTENT_LENGTH"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "CONTENT_LENGTH: "
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "SCRIPT_NAME"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "/wiki/index.php"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "SCRIPT_NAME: /wiki/index.php"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "REQUEST_URI"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "*/wiki/*"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "REQUEST_URI: */wiki/*"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "DOCUMENT_URI"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "/wiki/index.php"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "DOCUMENT_URI: /wiki/index.php"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "DOCUMENT_ROOT"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "/home/www/isotoperesearch.ca"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "DOCUMENT_ROOT: /home/www/isotoperesearch.ca"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "SERVER_PROTOCOL"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "HTTP/1.1"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "SERVER_PROTOCOL: HTTP/1.1"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "GATEWAY_INTERFACE"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "CGI/1.1"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "GATEWAY_INTERFACE: CGI/1.1"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "SERVER_SOFTWARE"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "nginx"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "SERVER_SOFTWARE: nginx"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "REMOTE_ADDR"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "127.0.0.1"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "REMOTE_ADDR: 127.0.0.1"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "REMOTE_PORT"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "56704"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "REMOTE_PORT: 56704"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "SERVER_ADDR"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "127.0.0.1"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "SERVER_ADDR: 127.0.0.1"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "SERVER_PORT"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "80"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "SERVER_PORT: 80"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script copy: "SERVER_NAME"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http script var: "localhost"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "SERVER_NAME: localhost"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "HTTP_TE: deflate,gzip;q=0.3"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "HTTP_CONNECTION: TE, close"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "HTTP_HOST: localhost"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 fastcgi param: "HTTP_USER_AGENT: lwp-request/6.15 libwww-perl/6.15"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http cleanup add: 09993C3C
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 get rr peer, try: 1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 stream socket 6
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 epoll add connection: fd:6 ev:80002005
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 connect to unix:/var/run/php/php7.0-fpm.sock, fd:6 #8
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 connected
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream connect: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 posix_memalign: 0998AA00:128 @16
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream send request
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream send request body
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 chain writer buf fl:0 s:544
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 chain writer in: 09993C5C
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 writev: 544 of 544
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 chain writer out: 00000000
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 event timer add: 6: 90000:2415705830
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http finalize request: -4, "/wiki/index.php?" a:1, c:3
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http request count:3 blk:0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http finalize request: -4, "/wiki/index.php?" a:1, c:2
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http request count:2 blk:0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http run request: "/wiki/index.php?"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream check client, write event:1, "/wiki/index.php"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream request: "/wiki/index.php?"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream dummy handler
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream request: "/wiki/index.php?"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream process header
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 malloc: 09999E18:4096
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 recv: eof:1, avail:1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 recv: fd:6 72 of 4096
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 01
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 06
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 00
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 01
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 00
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 2A
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 06
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 00
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record length: 42
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi parser: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi header: "Content-type: text/html; charset=UTF-8"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi parser: 1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi header done
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 posix_memalign: 0998F000:4096 @16
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 HTTP/1.1 200 OK
> Server: nginx/1.12.0
> Date: Sun, 17 Sep 2017 13:16:09 GMT
> Content-Type: text/html; charset=UTF-8
> Transfer-Encoding: chunked
> Connection: close
>
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 write new buf t:1 f:0 0998F010, pos 0998F010, size: 165 file: 0, size: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http write filter: l:0 f:0 s:165
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http cacheable: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream process upstream
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 pipe read upstream: 1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 pipe preread: 22
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 readv: eof:1, avail:0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 readv: 1, last:4024
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 pipe recv chain: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 pipe buf free s:0 t:1 f:0 09999E18, pos 09999E4A, size: 22 file: 0, size: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 pipe length: -1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 01
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 03
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 00
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 01
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 00
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 08
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 00
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record byte: 00
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi record length: 8
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http fastcgi sent end request
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 free: 09999E18
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 pipe write downstream: 1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 pipe write downstream done
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 event timer: 6, old: 2415705830, new: 2415705831
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream exit: 00000000
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 finalize http upstream request: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 finalize http fastcgi request
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 free rr peer 1 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 close http upstream connection: 6
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 free: 0998AA00, unused: 88
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 event timer del: 6: 2415705830
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 reusable connection: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http upstream temp fd: -1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http output filter "/wiki/index.php?"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http copy filter: "/wiki/index.php?"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 image filter
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http postpone filter "/wiki/index.php?" BFEBBC94
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http chunk: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 write old buf t:1 f:0 0998F010, pos 0998F010, size: 165 file: 0, size: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 write new buf t:0 f:0 00000000, pos 080F0A8B, size: 5 file: 0, size: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http write filter: l:1 f:0 s:170
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http write filter limit 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 writev: 170 of 170
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http write filter 00000000
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http copy filter: 0 "/wiki/index.php?"
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http finalize request: 0, "/wiki/index.php?" a:1, c:1
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http request count:1 blk:0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http close request
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 http log handler
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 free: 00000000
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 free: 09992DB0, unused: 4
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 free: 0998F000, unused: 3418
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 close http connection: 4
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 reusable connection: 0
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 free: 099AEEE8
> 2017/09/17 09:16:09 [debug] 21873#21873: *7 free: 0998ACC0, unused: 24
>
>
> Le 2017-09-17 à 08:28, Anoop Alias a écrit :
>
> try changing
>
> ##############################
>
> location = /wiki {
>       root /home/www/isotoperesearch.ca/wiki;
>       fastcgi_index index.php;
>       index index.php;
>       include fastcgi_params;
>       fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
>
> }
>
> ##############################
> to
>
> #################################
>
> location /wiki/ {
>       # root /home/www/isotoperesearch.ca/wiki;
>       fastcgi_index index.php;
>       index /wiki/index.php;
>       include fastcgi_params;
>       fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
>
> }
>
> ######################################3
>
> On Sun, Sep 17, 2017 at 5:48 PM, Etienne Robillard <tkadm30 at yandex.com>
> wrote:
>
>> Hi,
>>
>> I'm trying to configure nginx with php-fpm to run mediawiki in a distinct
>> location (/wiki).
>>
>> Here's my config:
>>
>> # configuration file /etc/nginx/nginx.conf:
>> user www-data;
>> worker_processes 4;
>> pid /run/nginx.pid;
>>
>> events {
>>     worker_connections 512;
>>     multi_accept on;
>>     use epoll;
>> }
>>
>> http {
>>
>>     ##
>>     # Basic Settings
>>     ##
>>
>>     sendfile on;
>>     tcp_nopush on;
>>     tcp_nodelay on;
>>     keepalive_timeout 80;
>>     types_hash_max_size 2048;
>>     # server_tokens off;
>>
>>     # server_names_hash_bucket_size 64;
>>     # server_name_in_redirect off;
>>
>>     include /etc/nginx/mime.types;
>>     default_type application/octet-stream;
>>
>>     ##
>>     # SSL Settings
>>     ##
>>
>>     ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
>>     ssl_prefer_server_ciphers on;
>>
>>     ##
>>     # Logging Settings
>>     ##
>>
>>     access_log /var/log/nginx/access.log;
>>     error_log /var/log/nginx/error.log;
>>
>>     ##
>>     # Gzip Settings
>>     ##
>>
>>     gzip off;
>>     gzip_disable "msie6";
>>
>>     # gzip_vary on;
>>     # gzip_proxied any;
>>     # gzip_comp_level 6;
>>     # gzip_buffers 16 8k;
>>     # gzip_http_version 1.1;
>>     # gzip_types text/plain text/css application/json
>> application/javascript text/xml application/xml application/xml+rss
>> text/javascript;
>>
>>     ##
>>     # Virtual Host Configs
>>     ##
>>
>>     #isotopesoftware.ca:
>>     #include /etc/nginx/conf.d/development.conf;
>>     include /etc/nginx/conf.d/isotoperesearch.conf;
>>     #include /etc/nginx/sites-enabled/*;
>> }
>>
>> server {
>>
>>     # static medias web server configuration, for development
>>     # and testing purposes.
>>
>>     listen       80;
>>     server_name  localhost;
>>     error_log /var/log/nginx/error_log; #debug
>>     root /home/www/isotoperesearch.ca;
>>     #autoindex on;
>>     client_max_body_size 5m;
>>     client_body_timeout 60;
>>
>>     location / {
>>     #    # host and port to fastcgi server
>>         #uwsgi_pass django; # 8808=gthc.org; 8801=tm
>>         #include uwsgi_params;
>>         fastcgi_pass 127.0.0.1:8808;
>>         include fastcgi_params;
>>     }
>>
>>
>>     # debug url rewriting to the error log
>>     rewrite_log on;
>>
>>     location /media {
>>         autoindex on;
>>         gzip on;
>>     }
>>
>>     location /pub {
>>         autoindex on;
>>         gzip on;
>>     }
>>
>>     location /webalizer {
>>         autoindex on;
>>         gzip on;
>>     #auth_basic "Private Property";
>>     #auth_basic_user_file /etc/nginx/.htpasswd;
>>         allow 67.68.76.70;
>>     deny all;
>>     }
>>
>>     location /documentation {
>>         autoindex on;
>>         gzip on;
>>     }
>>
>>     location /moin_static184 {
>>     autoindex on;
>>     gzip on;
>>     }
>>     location /favicon.ico {
>>     empty_gif;
>>     }
>>     location /robots.txt {
>>          root /home/www/isotopesoftware.ca;
>>     }
>>     location /sitemap.xml {
>>     root /home/www/isotopesoftware.ca;
>>     }
>>
>>     #location /public_html {
>>     # root /home/www/;
>>     # autoindex on;
>>     #}
>>     # redirect server error pages to the static page /50x.html
>>     #error_page 404 /404.html;
>>     #error_page 403    /403.html;
>>     #error_page 500 502 503 504  /50x.html;
>>     #location = /50x.html {
>>     #    root   /var/www/nginx-default;
>>     #}
>>
>>     include conf.d/mediawiki.conf;
>>     #include conf.d/livestore.conf;
>> }
>>
>>
>> # configuration file /etc/nginx/fastcgi_params:
>> fastcgi_param  PATH_INFO          $fastcgi_script_name;
>> fastcgi_param  QUERY_STRING       $query_string;
>> fastcgi_param  REQUEST_METHOD     $request_method;
>> fastcgi_param  CONTENT_TYPE       $content_type;
>> fastcgi_param  CONTENT_LENGTH     $content_length;
>>
>> fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
>> fastcgi_param  REQUEST_URI        $request_uri;
>> fastcgi_param  DOCUMENT_URI       $document_uri;
>> fastcgi_param  DOCUMENT_ROOT      $document_root;
>> fastcgi_param  SERVER_PROTOCOL    $server_protocol;
>>
>> fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
>> fastcgi_param  SERVER_SOFTWARE    nginx;
>>
>> fastcgi_param  REMOTE_ADDR        $remote_addr;
>> fastcgi_param  REMOTE_PORT        $remote_port;
>> #fastcgi_param  REMOTE_USER      $remote_user;
>> fastcgi_param  SERVER_ADDR        $server_addr;
>> fastcgi_param  SERVER_PORT        $server_port;
>> fastcgi_param  SERVER_NAME        $server_name;
>>
>>
>> #XXX
>> #fastcgi_param HTTP_IF_NONE_MATCH $http_if_none_match;
>> #fastcgi_param HTTP_IF_MODIFIED_SINCE $http_if_modified_since;
>>
>>
>> # PHP only, required if PHP was built with --enable-force-cgi-redirect
>> # fastcgi_param  REDIRECT_STATUS    200;
>>
>> fastcgi_send_timeout 90;
>> fastcgi_read_timeout 90;
>> fastcgi_connect_timeout 40;
>> #fastcgi_cache_valid 200 304 10m;
>> #fastcgi_buffer_size 128k;
>> #fastcgi_buffers 8 128k;
>> #fastcgi_busy_buffers_size 256k;
>> #fastcgi_temp_file_write_size 256k;
>>
>>
>> # configuration file /etc/nginx/conf.d/mediawiki.conf:
>>
>>
>> location = /wiki {
>>       root /home/www/isotoperesearch.ca/wiki;
>>       fastcgi_index index.php;
>>       index index.php;
>>       include fastcgi_params;
>>       fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
>>
>> }
>>
>> #location @mediawiki {
>> #    rewrite ^/(.*)$ /index.php;
>> #}
>>
>>
>> The issue is that the default "/" location is masking the fastcgi_pass
>> directive in the wiki block.
>>
>> Is there any ways to run php-fpm in a location block ?
>>
>>
>> Thank you in advance,
>>
>> Etienne
>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
>
> --
> *Anoop P Alias*
>
>
>
> _______________________________________________
> nginx mailing listnginx at nginx.orghttp://mailman.nginx.org/mailman/listinfo/nginx
>
>
> --
> Etienne Robillardtkadm30 at yandex.comhttp://www.isotopesoftware.ca/
>
>


-- 
*Anoop P Alias*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170917/d2afd030/attachment-0001.html>


More information about the nginx mailing list