Created
July 21, 2018 04:12
-
-
Save matthewpalmer/c9c423d9409ef30e09e0eac07716387d to your computer and use it in GitHub Desktop.
kubernetes php fpm nginx config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, create a ConfigMap whose contents are used | |
# as the nginx.conf file in the web server. | |
# This server uses /var/www/html as its | |
# root document directory. When the server gets a | |
# request for *.php, it will forward that request | |
# to our PHP-FPM container. | |
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: nginx-config | |
data: | |
nginx.conf: | | |
events { | |
} | |
http { | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
# Set nginx to serve files from the shared volume! | |
root /var/www/html; | |
server_name _; | |
location / { | |
try_files $uri $uri/ =404; | |
} | |
location ~ \.php$ { | |
include fastcgi_params; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_pass 127.0.0.1:9000; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment