Welcome! Log In Create A New Profile


настройка nginx+apache - httpd-vhosts

July 10, 2011 06:24PM
Решил поставить Nginx->Apache, nginx является frontend'ом, а apache соответственно backend'ом.

Возникла проблема при загрузке картинок т.е. директория сайтов находиться C://www/ сайтов около 5 штук
при заходе на сайт под доменом forum.domen.ru Nginx пытается загрузить картинки с адреса C://www/images
А должен загружать C://www/forum/images

Помогите решить проблему.

Мои настройки

настройки httpd-vhosts

<VirtualHost *:88>
ServerName forum.domen.ru
DocumentRoot "C:/www/Forum"
ErrorLog "C:/www/Forum/admin/erorr.log"

и т.д.

Настройки Nginx

worker_processes 2;
error_log C:/nginx/logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

events {
worker_connections 2000;

http {
include mime.types;
default_type application/octet-stream;
#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 logs/access.log main;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
keepalive_timeout 2m;
#gzip on;
server {
listen 80;
server_name _;
#access_log logs/host.access.log main;
location ~* \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|js)$ {
root C:/www;
access_log off;
expires 30d;
location ~ /\.ht {
deny all;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
#client_body_temp_path tmp/client_body_temp;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
#proxy_temp_path tmp/proxy_temp;
charset koi8-r;
#error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
Subject Author Posted

настройка nginx+apache - httpd-vhosts

GigA July 10, 2011 06:24PM

Re: настройка nginx+apache - httpd-vhosts

Alex Vorona July 11, 2011 09:02AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 176
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready