2013-07-10 2 views
0

Привет у меня есть следующий конфиг:субдоменов под Nginx с Shopware

server { 
listen 80; 
server_name example.com; 
client_max_body_size 24M; 
client_body_buffer_size 128k; 
server_name www.example.com; 
root /www/example.com/htdocs/; 

# Include shopware configuration. 
include /www/example.com/config/shopware.conf; 
} 

server { 
listen 80; 
server_name subdomain.example.com; 

client_max_body_size 24M; 
client_body_buffer_size 128k; 

root /www/example.com/subdomain/; 

# Include shopware configuration. 
include /www/example.com/config/shopware.conf; 
} 

server { 
listen 443; 
server_name example.com; 

# SSL 
ssl on; 
ssl_certificate /etc/ssl/private/www.example.com.crt; 
ssl_certificate_key /etc/ssl/private/www.example.com.key; 
ssl_ciphers    SSLv3+HIGH:RC4+MEDIUM:!aNULL:!eNULL:!3DES:!MD5:@STRENGTH; 
ssl_prefer_server_ciphers on; 
ssl_protocols    SSLv3; 
ssl_session_cache   shared:SSL:10m; 

client_max_body_size 24M; 
client_body_buffer_size 128k; 

server_name example.com; 
root /www/example.com/htdocs/; 

# Include shopware configuration. 
include /www/example.com/config/shopware.conf; 
} 

И проблема в том, когда я пытаюсь открыть subdomain.example.com, то я получаю НЕ НАЙДЕНО.

Environment

nginx version: nginx/0.7.67 
debian 6.0.7 

shopware.conf:

## File: /etc/nginx/global/shopware.conf 
## Author: Benjamin Cremer 
## Shopware 4 Nginx rules. 
## Designed to be included in any server {} block. 

location = /favicon.ico { 
log_not_found off; 
access_log off; 
} 

location = /robots.txt { 
allow all; 
log_not_found off; 
access_log off; 
} 

location = /templates/_default/backend/_resources/resources/css/icon-set.css { 
gzip off; 
} 

## Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). 
location ~ /\. { 
deny all; 
access_log off; 
log_not_found off; 
} 

## Deny all attems to access possible configuration files 
location ~ \.(tpl|yml|ini)$ { 
deny all; 
} 

## Deny access to media upload folder 
location ^~ /media/temp/ { 
deny all; 
} 

location ^~ /cache/ { 
deny all; 
} 

location ^~ /files/documents/ { 
deny all; 
} 

# Breaks backend/media/ rewrite 
# 
#location ~ /(engine|files|templates|media)/ { 
# location ~ \.php$ { 
#  return 403; 
# } 
#} 

location /check/ { 
index index.php; 
try_files $uri /check/index.php?$args; 
} 

location /install { 
index index.php; 
try_files $uri /install/index.php?$args; 
} 


location/{ 
index index.html index.php shopware.php 
      rewrite shopware.dll /shopware.php; 
      rewrite files/documents/.* /engine last; 
      rewrite images/ayww/(.*) /images/banner/$1 last; 
      rewrite backend/media/(.*) media/$1 last; 
      if (!-e $request_filename){ 
       rewrite . /shopware.php last; 
      } 
## Defining rewrite rules 
# rewrite^https://www.kotel.de permanent; 
#rewrite files/documents/.* /engine last; 
#rewrite backend/media/(.*) /media/$1 last; 

location ~* ^.+\.(?:css|js|jpe?g|gif|ico|png|html|xml)$ { 
    expires 1w; 
    add_header Pragma public; 
    add_header Cache-Control "public, must-revalidate, proxy-revalidate"; 

    access_log off; 



    # The directive enables or disables messages in error_log about files not found on disk. 
    log_not_found off; 

    tcp_nodelay off; 
    ## Set the OS file cache. 
    open_file_cache max=3000 inactive=120s; 
    open_file_cache_valid 45s; 
    open_file_cache_min_uses 2; 
    open_file_cache_errors off; 
} 

index shopware.php index.php; 
try_files $uri $uri/ /shopware.php?$args; 
} 

## XML Sitemap support. 
location = /sitemap.xml { 
try_files $uri /shopware.php?controller=SitemapXml; 
} 

location ~ \.php$ { 
try_files $uri =404; 

## NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini 
fastcgi_split_path_info ^(.+\.php)(/.+)$; 

#fastcgi_keep_conn on; 

fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name; 
include fastcgi_params; 

fastcgi_buffers 8 16k; 
fastcgi_buffer_size 32k; 

fastcgi_pass php-fpm; 
} 

может кто-нибудь дать мне мир советов, что я делаю не так?

Спасибо, Стивен

+0

уточненный конфигурации для запуска shopware с Nginx можно найти здесь: https://github.com/bcremer/shopware- с-nginx –

ответ

0

Ну как вы перечислили в вашем конф, ваш поддомен, как это

server { 
    listen 80; 
    server_name subdomain.example.com; 

    client_max_body_size 24M; 
    client_body_buffer_size 128k; 

    root /www/example.com/subdomain/; 

    # Include shopware configuration. 
    include /www/example.com/config/shopware.conf; 
} 

EDIT: Так внутри shopware.conf Theres линию, которая говорит fastcgi_pass php-fpm;, я m не уверен, что если это правильно работает, если вы получаете сообщение о плохой шлюзе, то это то, что вам нужно исправить, попробуйте заменить его любой из этих строк и посмотреть, какие работы

fastcgi_pass unix:/var/run/php5-fpm.sock; 

или

fastcgi_pass 127.0.0.1:9000; 

Я думаю, что один из тех, кто должен работать

+0

Я обновил начальную запись Спасибо, вперед, Steven :) –

+0

ok, поэтому я не нашел подходящего 'fastcgi_pass', но есть один в конце файла магазина, я думаю, вам нужно изменить это, плохо отредактировать ответ и показать u –

Смежные вопросы