View Single Post
Old 5th November 2012, 10:47
Totenkopf Totenkopf is offline
Junior Member
Join Date: Oct 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On CentOS 6.3


Im currently running several shopware4 installations on an apache server with mod_php and pure-ftp, but ive got the problem, that i cant use the ftp server properly, because of mod_php. Now i wanted to make a sampole installation inside a VM with nginx and php-fpm and i already understood the syntax of nginx config files, but i cvant manage to get the installation of shopware running, because of the redirect rules. I can open my shopware basic folder, with the warning, that i should install shopware first and i can see the first page of the installation process, but right after i tried to change the language, or to go to the 2nd step, i get thron back to the shopware.php main site with the warning.

First my configs:


user nginx;
worker_processes 4;

error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

pid /var/run/;

events {
worker_connections 1024;

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

## Detect when HTTPS is used
map $scheme $fastcgi_https {
default off;
https on;

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 2;

# Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*.conf;

server {
listen 80; # Listen to Port 80
server_name; # Replace with Server-Name
access_log /var/log/nginx/localhost.access.log;

location / {
root /var/www/; #Define doc-root
include /var/www/shopware.conf; #Include shopware specific nginx rules

# Use php-fpm as fast-cgi backend for all .php files
location ~ .php$ {
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;

# Shopware nginx rules
# version 1.0
# date 09.08.2011
# author Stefan Hamann <>

# Defining various options

# Set DirectoryIndex
index shopware.php index.php;

# Deny direct access to all smarty templates
location ~ ^/templates/.*/*.tpl {
deny all;

# Permit access to php files in web readable directories
location ~ ^/cache/.*/*.(php|cgi|php5|php3|php4|phtml|pl|py) {
deny all;
location ~ ^/images/.*/*.(php|cgi|php5|php3|php4|phtml|pl|py) {
deny all;
location ~ ^/files/.*/*.(php|cgi|php5|php3|php4|phtml|pl|py) {
deny all;
location ~ ^/upload/.*/*.(php|cgi|php5|php3|php4|phtml|pl|py) {
deny all;

# Defining rewrite rules
rewrite /images/ayww/(.*) /images/banner/$1 last;
rewrite /files/documents/.* /engine last;
rewrite /templates/(.*(css|js))$ /engine/backend/php/sCacheTemplate.php?file=/templates/$1 last;
rewrite /sitemap.xml(.*) /shopware.php?controller=SitemapXml;
rewrite /application.yaml /engine last;
rewrite /engine/core/php/sAjaxSearch.php$ /engine/backend/php/sAjaxSearch.php last;
rewrite /engine/core/php/campaigns.php$ /engine/backend/php/campaigns.php last;

# Defining controller based route processing behaviour
if (!-e $request_filename) {
rewrite . /shopware.php last;
I do have a file to, located at /etc/nginx/sites-available with link to sites-enabled, but this one is ignored...

Any ideas or suggestions?
Reply With Quote
Sponsored Links