I offered the reference though ...Where in documentation you saw that?
I don't have that info and is not present in the Wiki also. I will ask Igor to see what is going on.
void
ngx_http_handler(ngx_http_request_t *r)
{
...
if (!r->internal) {
...
} else {
cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
r->phase_handler = cmcf->phase_engine.server_rewrite_index;
}
...
r->write_event_handler = ngx_http_core_run_phases;
ngx_http_core_run_phases(r);
}
ngx_int_t
ngx_http_core_find_config_phase(ngx_http_request_t *r,
ngx_http_phase_handler_t *ph)
{
...
if (!r->internal && clcf->internal) {
ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
return NGX_OK;
}
...
}
Sorry Edited to the correct URLWhat is that link? Is pointing to a domain for sale.
Did Igor confirmed what was stated above, in previous posts?
I don't see anywhere access being blocked to location, as is intended to be used in first place by .htaccess files made by Kier. The "internal" condition is just a simple redirect, nothing more.
No that's exactly not the pointThat is exactly my point.
"internal" is used to do an internal redirect, that's all.
It is exactly used for the purpose of blocking external access to a location.From the start, internal was designed to be used as internal 404, as explained in the Wiki. I don't understand why you keep saying that is better to use it, when the function was not designed for the purpose of blocking access to a location?
server {
listen 80;
root /usr/share/nginx/www;
index index.php;
location / {
try_files $uri $uri/ /index.html;
}
location /doc {
root /usr/share;
autoindex on;
allow 127.0.0.1;
deny all;
}
location /images {
root /usr/share;
autoindex off;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php last;
}
}
fastcgi_param SCRIPT_FILENAME /blah/blah/location/to/your/xf/installation/$fastcgi_script_name;
location /xf/ {
try_files $uri $uri/ /xf/index.php?$uri&$args;
index index.php index.html;
}
location /xf/(internal_data|library)/ {
internal;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location /xf/(internal_data|library)/ {
internal;
}
location /xf/internal_data/ {
internal;
}
location /xf/library/ {
internal;
}
location /xf/ {
try_files $uri $uri/ /xf/index.php?$uri&$args;
index index.php index.html;
}
server {
listen 80;
server_name www.xyz.com xfprod.xxx.com xxx.com;
access_log /srv/www/xxx.com/logs/access.log;
error_log /srv/www/xxx.com/logs/error.log;
location / {
root /srv/www/xxx.com/public_html;
index index.php index.html index.htm;
}
location /xf/ {
try_files $uri $uri/ /xf/index.php?$uri&$args;
index index.php index.html;
}
location /xf/internal_data/ {
internal;
}
location /xf/library/ {
internal;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/www/xxx.com/public_html$fastcgi_script_name;
}
}
server {
server_name .domain.tld;
index index.html index.php;
root /var/www/domain.tld;
location / {
try_files $uri $uri/ /index.php?$uri&$args;
}
location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|swf|wav)$ {
add_header Cache-Control public;
expires max;
}
location ~ ^/(internal_data|library)/(.*)$ {
internal;
}
location ~ ^(.+\.php)(.*)$ {
include /etc/nginx/fastcgi_params;
include /etc/nginx/php_params;
}
}
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_ignore_client_abort on;
fastcgi_pass unix:/var/run/php-fpm.www.sock;
#site root
location / {
root /blah/blah/public;
index index.html index.htm index.php;
}
#xf root
location /xf/ {
root /blah/blah/public;
index index.php index.html index.htm;
try_files $uri $uri/ /xf/index.php?$uri&$args;
}
#no access
location /xf/internal_data/ {
root /blah/blah/public;
internal;
}
#no access
location /xf/library/ {
root /blah/blah/public;
internal;
}
#no access
location /xf/data/ {
root /blah/blah/public;
internal;
}
#php fast-cgi
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /blah/blah/public$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort on;
}
Code:location /xf/ { try_files $uri $uri/ /xf/index.php?$uri&$args; index index.php index.html; }
When I have that enabled I am having major problems with images and javascripts doesn't seem to work.
Commenting out those lines solves the issue.
my full config for that virtual site is
Code:-snip-
We use essential cookies to make this site work, and optional cookies to enhance your experience.