Jump to content
  • 0

пытаюсь настроить nginx + apache + mod_vhost_alias


mitiya
 Share

Question

тытаюсь сделать как вот тут

вроде как бы за работало, но ...

поставил modx

пытаюсь войти в manager ( mydomen.ru/manager)

в перый раз заходит, но когда в нем например созраняю настройки, что вызывает перезагрузку страницы почему происходит редирект на mydomen.ru:81/manager

ну соответственно ничего не грузится.

конфиг apache


<VirtualHost *>
UseCanonicalName Off
VirtualDocumentRoot /home/htdocs/%0/www
php_admin_value auto_prepend_file /home/htdocs/fix_doc_root.php
DirectoryIndex index.php index.html index.htm
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/htdocs/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

конфиг nginx


user www-data;
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
# log options
log_format main '$host: $remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" '
'"$gzip_ratio"';
# nginx options
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65 20;
# fastcgi
#fastcgi_intercept_errors on;
server {
listen 80;
location / {
proxy_pass http://127.0.0.1:81;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
# Static files location
location ~* \.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf)$
{
if (!-d /home/htdocs/$host/www ) {
set $cur_host "default";
access_log '/var/log/nginx/default.log' main;
}
if (-d /home/htdocs/$host/www ) {
set $cur_host $host;
access_log '/var/log/nginx/host_access.log' main;
}
root /home/htdocs/$cur_host/www;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Я не силен в nginx но вот эта строка явно говорит о проксировании на 81-ый порт


proxy_pass http://127.0.0.1:81;

при том что прослушивается 80-ый порт

апач слушает 81 порт да, забыл написать.

ngnix соответственно на 80 и проксирует в 81

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy