Skip to content

Small modifications to make the nginx conf more universal #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM debian:jessie
MAINTAINER Joeri Verdeyen <joeriv@yappa.be>

ENV PHP_FPM_SOCKET "php:9000"
ENV DOCUMENT_ROOT /var/www/app/web
ENV INDEX_FILE app_dev.php
ENV DOCUMENT_ROOT /var/www
ENV INDEX_FILE index.php

RUN apt-get update && \
apt-get install -y nginx && \
Expand Down
16 changes: 7 additions & 9 deletions default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ server {
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location / {
index INDEX_FILE;

try_files $uri @rewriteapp;
}
index INDEX_FILE;

location @rewriteapp {
rewrite ^(.*)$ /INDEX_FILE/$1 last;
location / {
try_files $uri $uri/ /INDEX_FILE$is_args$args;
}

location ~ ^/INDEX_FILE(/|$) {
location ~ \.php$ {
try_files $uri =404;
fastcgi_index INDEX_FILE;
fastcgi_pass php-upstream;
fastcgi_param SERVER_NAME $host;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
Expand Down Expand Up @@ -54,4 +52,4 @@ server {
fastcgi_param HTTPS off;
fastcgi_read_timeout 120;
}
}
}