Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By delfo2000 on
Dear,
I have nginx frontend and apache backend (I'm using Vestacp), now drupal 7.50 doesn't see external IP and log only server IP where I have installed drupal. I have controlled apache log and external IP are logged, but drupal can't read, my nginx.conf an apache2.conf where I have replaced mi internl IP with "x.x.x.x" and my domain with "mydomain.com"
nginx.conf
server {
listen x.x.x.x:80;
server_name mydomain.com www.mydomain.com;
error_log /var/log/apache2/domains/mydomain.com.error.log error;
location / {
proxy_pass http://x.x.x.x:8080;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|z$
root /home/admin/web/mydomain.com/public_html;
access_log /var/log/apache2/domains/mydomain.com.log combined;
access_log /var/log/apache2/domains/mydomain.com.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias /home/admin/web/mydomain.com/document_errors/;
}
location @fallback {
proxy_pass http://x.x.x.x:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
disable_symlinks if_not_owner from=/home/admin/web/mydomain.com/public_html;
include /home/admin/conf/web/nginx.mydomain.com.conf*;
}
apache2.conf
<VirtualHost x.x.x.x:8080>
ServerName mydomain.com
ServerAlias www.mydomain.com
ServerAdmin info@mydomain.com
DocumentRoot /home/admin/web/mydomain.com/public_html
ScriptAlias /cgi-bin/ /home/admin/web/mydomain.com/cgi-bin/
Alias /vstats/ /home/admin/web/mydomain.com/stats/
Alias /error/ /home/admin/web/mydomain.com/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/apache2/domains/mydomain.com.bytes bytes
CustomLog /var/log/apache2/domains/mydomain.com.log combined
ErrorLog /var/log/apache2/domains/mydomain.com.error.log
<Directory /home/admin/web/mydomain.com/public_html>
AllowOverride All
Options +Includes -Indexes +ExecCGI
</Directory>
<Directory /home/admin/web/mydomain.com/stats>
AllowOverride All
</Directory>
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>
IncludeOptional /home/admin/conf/web/apache2.mydomain.com.conf*
</VirtualHost>
I can uderstand where is my error, and how configure drupal 7.50 for read external IP passed from apache.
I hope in little help.
Regards
Comments
Did you figure out? I'm
Did you figure out? I'm facing same issue.