Skip to content
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

PHP Support #17

Open
dbogatov opened this issue Feb 9, 2017 · 2 comments
Open

PHP Support #17

dbogatov opened this issue Feb 9, 2017 · 2 comments

Comments

@dbogatov
Copy link

dbogatov commented Feb 9, 2017

Hi,

Is it possible at the moment to serve PHP site with this image?

I have NGINX config like this:

server {
	listen 8006;
	server_name _;

	root /location/;
	index index.php index.html index.htm default.html default.htm;

	client_max_body_size 100M;
	
	location / {
		try_files $uri $uri/ /index.php?$args;
	}

	# deny running scripts inside writable directories
	location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
		return 403;
		error_page 403 /403_error.html;
	}
	
	location ~ \.php$ {
		fastcgi_pass unix:/run/php/php7.0-fpm.sock;
		fastcgi_index index.php;
		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
		include /etc/nginx/fastcgi_params;
	}
	
	# caching of files
	location ~* \.(ico|pdf|flv)$ {
		expires 1y;
	}

	location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
		expires 14d;
	}
}

When I run the container, it does not seem to work. Does not even print logs.

@KyleAMathews
Copy link
Owner

KyleAMathews commented Feb 9, 2017 via email

@dbogatov
Copy link
Author

PHP-FPM (ideally of version 7) is needed.

I was inspired by your work and created my own NGINX container (for my quite specific needs).
It supports PHP 7 and runs on alpine (total size 18M).

Take a look if you'd like.
https://git.dbogatov.org/dbogatov/Docker-Containers/tree/master/NGINX

I am leaving the issue open in case you would like to add PHP support some day.
Feel free to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants