Heroku is throwing repeated 302 redirects for all urls going to the base URL, and I don't know why. Everything works fine locally on my dev server.
Procfile:
web: fuel/vendor/bin/heroku-php-apache2 web/
.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
Options +FollowSymLinks -Indexes
# Remove index.php from URL
RewriteCond %{HTTP:X-Requested-With} !^XMLHttpRequest$
RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
RewriteRule ^index\.php(.*)$ $1 [R=301,NS,L]
RewriteRule ^(/)?$ index.php/$1 [L]
# make HTTP Basic Authentication work on php5-fcgi installs
<IfModule mod_fcgid.c>
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
# Send request via index.php if not a real file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# deal with php5-cgi first
<IfModule mod_fcgid.c>
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
<IfModule !mod_fcgid.c>
# for normal Apache installations
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# for Apache FGCI installations
<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
</IfModule>
</IfModule>
Pages that actually exist get loaded.
404s work correctly, loading a 404 page:
2015-11-04T19:13:55.489566+00:00 heroku[router]: at=info method=GET path="/admin/test/" host=my.url request_id=b4c4853b-69fe-444e-b03b-5eea7c10b018 fwd="73.218.177.115" dyno=web.1 connect=1ms service=15ms status=404 bytes=6156
Locations that should "exist" by being redirected to FuelPHP get redirected down to the base URL..
I try to load my.url/admin or my.url/admin/clients and I'm redirected to my.url.
2015-11-04T19:14:08.858400+00:00 heroku[router]: at=info method=GET path="/admin/" host=my.url request_id=7a16369b-e647-4399-b11d-a1522d9766a7 fwd="73.218.177.115" dyno=web.1 connect=3ms service=19ms status=302 bytes=1235
2015-11-04T19:14:08.894102+00:00 heroku[router]: at=info method=GET path="/" host=my.url request_id=5780087d-0847-40e6-9a44-b0dabd58577e fwd="73.218.177.115" dyno=web.1 connect=1ms service=5ms status=200 bytes=205
2015-11-04T19:14:08.854106+00:00 app[web.1]: 10.63.87.95 - - [04/Nov/2015:19:14:08 +0000] "GET /admin/ HTTP/1.1" 302 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
2015-11-04T19:14:08.889796+00:00 app[web.1]: 10.63.87.95 - - [04/Nov/2015:19:14:08 +0000] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
2015-11-04T19:14:18.756248+00:00 heroku[router]: at=info method=GET path="/" host=my.url request_id=6eb6d76e-9f0c-4be0-b52a-220a459b9c57 fwd="73.218.177.115" dyno=web.1 connect=1ms service=4ms status=200 bytes=205
2015-11-04T19:14:18.715333+00:00 app[web.1]: 10.63.87.95 - - [04/Nov/2015:19:14:18 +0000] "GET /admin/clients/ HTTP/1.1" 302 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
2015-11-04T19:14:18.719632+00:00 heroku[router]: at=info method=GET path="/admin/clients/" host=my.url request_id=b15304cf-cd01-4cd6-9613-71d332fcc5a4 fwd="73.218.177.115" dyno=web.1 connect=1ms service=19ms status=302 bytes=1235
2015-11-04T19:14:18.752065+00:00 app[web.1]: 10.63.87.95 - - [04/Nov/2015:19:14:18 +0000] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36
Slightly modified app/classes/controller/admin.php
public function action_login()
{
// Already logged in
Auth::check() and Response::redirect('admin');
$val = Validation::forge();
if (Input::method() == 'POST')
{
$val->add('email', 'Email or Username')
->add_rule('required');
$val->add('password', 'Password')
->add_rule('required');
if ($val->run())
{
if ( ! Auth::check())
{
if (Auth::login(Input::post('email'), Input::post('password')))
{
// assign the user id that lasted updated this record
foreach (\Auth::verified() as $driver)
{
if (($id = $driver->get_user_id()) !== false)
{
// credentials ok, check access level
$user = Model\Auth_User::find($id[1]);
// ADDED THIS TO CHECK ADMIN LEVEL ACCESS
if ($user->group >= 80) {
//logged in! yay!
$current_user = $user;
Session::set_flash('success', e('Welcome, ' . $current_user->username));
Response::redirect('admin');
}
else {
$this->template->set_global('login_error', 'No access!');
break;
}
}
}
}
else
{
$this->template->set_global('login_error', 'Login failed!');
}
}
else
{
$this->template->set_global('login_error', 'Already logged in!');
}
}
}
$this->template->title = 'Login';
$this->template->subtitle = 'See all the things!';
$this->template->content = View::forge('admin/login', array('val' => $val), false);
}
Thoughts?
Related
I am trying to use Node.js to read phoenix channels using npm package phoenix-channels. Phoenix channels are multiplexed on top of websockets. I'm using an NGINX proxy in front of my phoenix webserver, so for NGINX, it's just a websocket.
Phoenix channels work fine going to a web page, as you can see here (you'll see data coming through in the web page).
It also works fine from nodejs on my internal network:
test_chan.js (with explicit IP and port):
const { Socket } = require('phoenix-channels')
let socket = new Socket("https://192.168.1.113:4445/socket")
socket.connect()
// Now that you are connected, you can join channels with a topic:
let channel = socket.channel("room:lobby", {})
channel.on("new_msg", payload => {
console.log(`${payload.body}`);
});
channel.join()
.receive("ok", resp => { console.log("Joined successfully", resp) })
.receive("error", resp => { console.log("Unable to join", resp) })
However if I replace the explicity IP:PORT address with the domain name, and run it from externally, it doesn't work (the only difference here from the script above is the URL):
test_chan.js (through domain name, and via my NGINX proxy):
const { Socket } = require('phoenix-channels')
let socket = new Socket("https://suprabonds.com/socket")
socket.connect()
// Now that you are connected, you can join channels with a topic:
let channel = socket.channel("room:lobby", {})
channel.on("new_msg", payload => {
console.log(`${payload.body}`);
});
channel.join()
.receive("ok", resp => { console.log("Joined successfully", resp) })
.receive("error", resp => { console.log("Unable to join", resp) })
So the suprabonds.com websockets works fine in a browser through the proxy, but doesn't work as a nodejs script.
Here is my nginx conf for suprabonds.com:
sites-enabled relevant server section:
server {
server_name suprabonds.com www.suprabonds.com;
location / {
proxy_pass http://localhost:4445;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/suprabonds.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/suprabonds.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
Any idea as to what I'm doing wrong?
EDIT
Here are the /var/log/nginx/access.log latest entries:
86.143.74.170 - - [22/Apr/2021:15:52:56 +0000] "GET /socket/websocket?vsn=1.0.0 HTTP/1.1" 301 178 "-" "-"
86.143.74.170 - - [22/Apr/2021:15:52:58 +0000] "GET /socket/websocket?vsn=1.0.0 HTTP/1.1" 301 178 "-" "-"
86.143.74.170 - - [22/Apr/2021:15:53:03 +0000] "GET /socket/websocket?vsn=1.0.0 HTTP/1.1" 301 178 "-" "-"
86.143.74.170 - - [22/Apr/2021:15:53:08 +0000] "GET /phoenix/live_reload/socket/websocket?vsn=2.0.0 HTTP/1.1" 101 143 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0"
86.143.74.170 - - [22/Apr/2021:15:53:08 +0000] "GET /socket/websocket?token=undefined&vsn=2.0.0 HTTP/1.1" 101 113098 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0"
86.143.74.170 - - [22/Apr/2021:15:53:19 +0000] "GET /phoenix/live_reload/socket/websocket?vsn=2.0.0 HTTP/1.1" 101 79 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0"
86.143.74.170 - - [22/Apr/2021:15:53:19 +0000] "GET /socket/websocket?token=undefined&vsn=2.0.0 HTTP/1.1" 101 27025 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0"
86.143.74.170 - - [22/Apr/2021:15:53:20 +0000] "GET /socket/websocket?token=undefined&vsn=2.0.0 HTTP/1.1" 101 479 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0"
86.143.74.170 - - [22/Apr/2021:15:53:20 +0000] "GET /phoenix/live_reload/socket/websocket?vsn=2.0.0 HTTP/1.1" 101 79 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0"
86.143.74.170 - - [22/Apr/2021:15:53:23 +0000] "GET /socket/websocket?vsn=1.0.0 HTTP/1.1" 301 178 "-" "-"
86.143.74.170 - - [22/Apr/2021:15:53:24 +0000] "GET /socket/websocket?vsn=1.0.0 HTTP/1.1" 301 178 "-" "-"
86.143.74.170 - - [22/Apr/2021:15:53:26 +0000] "GET /socket/websocket?vsn=1.0.0 HTTP/1.1" 301 178 "-" "-"
86.143.74.170 - - [22/Apr/2021:15:53:31 +0000] "GET /socket/websocket?vsn=1.0.0 HTTP/1.1" 301 178 "-" "-"
86.143.74.170 - - [22/Apr/2021:15:53:41 +0000] "GET /socket/websocket?vsn=1.0.0 HTTP/1.1" 301 178 "-" "-"
The firefox ones are the ones that work fine. The others (with 301 178 in them) are the ones from the non-working Node.js script (that is, the one using the domain name). The error.log file in the same location is empty.
Please note that I'm also using noip dynamic dns.
If you change your URL to:
let socket = new Socket("wss://suprabonds.com/socket/websocket?token=undefined")
or
let socket = new Socket("wss://suprabonds.com/socket/websocket?vsn=1.0.0")
It will connect
Iam trying to create a grok logstash filter for my log4js log.
The code in my nodejs app is as follows:
var httpLogFormat = ':remote-addr - - [:date] ":method :url ' + 'HTTP/:http-version" :status :res[content-length] ' + '":referrer" ":user-agent" :response-time';
log4js.loadAppender('file');
log4js.addAppender(log4js.appenders.file('logs/access.log'), 'access');
var logger = log4js.getLogger('access');
app.use(log4js.connectLogger(logger, { level: 'auto', format: httpLogFormat }));
This results in the following log message:
[2017-01-31 08:54:32.491] [WARN] access - 192.1.1.10 - - [Tue, 31 Jan 2017 07:54:32 GMT] "GET /api/test HTTP/1.0" 304 undefined "https://localhost.com/test" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36" 111
My current grok filter looks like this (UPDATED):
grok {
match => { "message" => "\[%{HTTPDATE:timestamp}\] \[%{WORD:loglevel}\] %{WORD:logtype} - %{IPORHOST:clientip} %{USER:ident} %{USER:auth} \"%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})\" %{NUMBER:response} - \"%{DATA:rawrequest}\" \"%{QS:agent}\""}
}
There is some parsing errors, and i suspect it is due to the [] but i'am unsure.
http://grokconstructor.appspot.com/ fails with:
NOT MATCHED. The longest regex prefix matching the beginning of this line is as follows:
prefix "
before match: [2017-01-31 08:54:32.491] [WARN] access - 192.1.1.10 - - [Tue, 31 Jan 2017 07:54:32 GMT]
after match: GET /api/test HTTP/1.0" 304 undefined "https://test.localhost.com/test" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36" 111
I've updated the grok to work for your example. I think you were misusing a few of the types (QS for example you don't need to have the "'s around it):
\[%{GREEDYDATA:timestamp}\]\ \[%{WORD:loglevel}\]\ %{WORD:logtype}\ -\ %{IPORHOST:clientip}\ %{USER:ident}\ %{USER:auth}\ \[%{GREEDYDATA}\]\ \"%{WORD:verb}\ %{NOTSPACE:request}(?: HTTP\/%{NUMBER:httpversion}|)\"\ %{NUMBER:response}\ %{WORD}\ \"%{DATA:rawrequest}\"\ %{QS:agent}\ %{INT:time_taken}
Check the docs for other words you can use.
Your parsing issues are probably down to literal use of the [ and ] characters as they are used in regex's, they need to be escaped as in my example.
I've deployed an application on Wildfly 10, that is working correctly on GlassFish, but I'm getting a blank page /<context_path>/j_security_check when I try to login.
I've looked some posts suggesting to include cache control request headers, but it didn't resolve the problem.
The logs do not show any kind of error or relevant information and I really don't know what to try next.
Has anyone experienced any similar issue?
EDIT 1
The authentication is working correctly. If, afterwards, I try to access a protected resource, I'm able to do so. It's just the redirect after the login that is not being triggered.
EDIT 2
The Request/Response dump:
----------------------------REQUEST---------------------------
URI=/ecc
characterEncoding=null
contentLength=-1
contentType=null
cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=Accept=text/html, application/xhtml+xml, */*
header=Connection=Keep-Alive
header=Accept-Language=pt-PT
header=Accept-Encoding=gzip, deflate
header=Cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
header=Host=localhost:8443
locale=[pt_PT]
method=GET
protocol=HTTP/1.1
queryString=
remoteAddr=/127.0.0.1:62990
remoteHost=sibshare
scheme=https
host=localhost:8443
serverPort=8443
--------------------------RESPONSE--------------------------
contentLength=0
contentType=null
header=Connection=keep-alive
header=X-Powered-By=Undertow/1
header=Server=WildFly/10
header=Location=https://localhost:8443/ecc/
header=Content-Length=0
header=Date=Mon, 09 May 2016 08:18:33 GMT
status=302
==============================================================
2016-05-09 09:18:33,890 INFO [stdout] (default task-5) [DEBUG] ecc_src - NoCacheFilter:Initializing filter
2016-05-09 09:18:33,902 INFO [io.undertow.request.dump] (default task-5)
----------------------------REQUEST---------------------------
URI=/ecc/
characterEncoding=null
contentLength=-1
contentType=null
cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=Accept=text/html, application/xhtml+xml, */*
header=Connection=Keep-Alive
header=Accept-Language=pt-PT
header=Accept-Encoding=gzip, deflate
header=Cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
header=Host=localhost:8443
locale=[pt_PT]
method=GET
protocol=HTTP/1.1
queryString=
remoteAddr=/127.0.0.1:62989
remoteHost=sibshare
scheme=https
host=localhost:8443
serverPort=8443
--------------------------RESPONSE--------------------------
contentLength=239
contentType=text/html
header=Expires=Thu, 01 Jan 1970 00:00:00 GMT
header=Cache-Control=no-cache, no-store, must-revalidate
header=X-Powered-By=Undertow/1
header=Server=WildFly/10
header=Pragma=no-cache
header=Accept-Ranges=bytes
header=Date=Mon, 09 May 2016 08:18:33 GMT
header=Connection=keep-alive
header=ETag=W/"239-1462554016000"
header=Last-Modified=Fri, 06 May 2016 17:00:16 GMT
header=Content-Type=text/html
header=Content-Length=239
status=200
==============================================================
2016-05-09 09:18:34,112 INFO [io.undertow.request.dump] (default task-6)
----------------------------REQUEST---------------------------
URI=/ecc/secure/home.jsf
characterEncoding=null
contentLength=-1
contentType=null
cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=Accept=text/html, application/xhtml+xml, */*
header=Connection=Keep-Alive
header=Accept-Language=pt-PT
header=Accept-Encoding=gzip, deflate
header=Cookie=EPMSID=sfTmDLw92HjAhwfY7HUei5fzlUbwKjxUg3EhyTMk.d014349
header=User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
header=Host=localhost:8443
locale=[pt_PT]
method=GET
protocol=HTTP/1.1
queryString=
remoteAddr=sibshare/127.0.0.1:62990
remoteHost=sibshare
scheme=https
host=localhost:8443
serverPort=8443
--------------------------RESPONSE--------------------------
contentLength=2897
contentType=text/html;charset=UTF-8
cookie=EPMSID=KcblRlqogTv4hCuVtjeL27onM3Nbp04k--DDZfnt.d014349; domain=null; path=/ecc
header=Expires=0
header=Expires=0
header=Cache-Control=no-cache, no-store, must-revalidate
header=Cache-Control=no-cache, no-store, must-revalidate
header=X-Powered-By=Undertow/1
header=Set-Cookie=EPMSID=KcblRlqogTv4hCuVtjeL27onM3Nbp04k--DDZfnt.d014349; path=/ecc; secure; HttpOnly
header=Server=WildFly/10
header=Pragma=no-cache
header=Pragma=no-cache
header=Date=Mon, 09 May 2016 08:18:34 GMT
header=Connection=keep-alive
header=Content-Type=text/html;charset=UTF-8
header=Content-Length=2897
status=200
==============================================================
2016-05-09 09:18:44,841 INFO [io.undertow.request.dump] (default task-13)
----------------------------REQUEST---------------------------
URI=/ecc/j_security_check
characterEncoding=null
contentLength=68
contentType=[application/x-www-form-urlencoded]
cookie=EPMSID=KcblRlqogTv4hCuVtjeL27onM3Nbp04k--DDZfnt.d014349
header=Accept=text/html, application/xhtml+xml, */*
header=Accept-Language=pt-PT
header=Cache-Control=no-cache
header=Accept-Encoding=gzip, deflate
header=User-Agent=Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
header=Connection=Keep-Alive
header=Content-Type=application/x-www-form-urlencoded
header=Content-Length=68
header=Cookie=EPMSID=KcblRlqogTv4hCuVtjeL27onM3Nbp04k--DDZfnt.d014349
header=Referer=https://localhost:8443/ecc/secure/home.jsf
header=Host=localhost:8443
locale=[pt_PT]
method=POST
protocol=HTTP/1.1
queryString=
remoteAddr=sibshare/127.0.0.1:62993
remoteHost=sibshare
scheme=https
host=localhost:8443
serverPort=8443
--------------------------RESPONSE--------------------------
contentLength=0
contentType=null
cookie=EPMSID=JtIoopj1u-p_Ko95XwYi45HqkdzNBVRxSklVFQEL.d014349; domain=null; path=/ecc
header=Expires=0
header=Cache-Control=no-cache, no-store, must-revalidate
header=X-Powered-By=Undertow/1
header=Set-Cookie=EPMSID=JtIoopj1u-p_Ko95XwYi45HqkdzNBVRxSklVFQEL.d014349; path=/ecc; secure; HttpOnly
header=Server=WildFly/10
header=Pragma=no-cache
header=Date=Mon, 09 May 2016 08:18:44 GMT
header=Connection=keep-alive
header=Content-Length=0
status=200
==============================================================
I eventually figured out what is wrong.
In my login page I've the following listener configured for invalidating the active session:
<f:metadata>
<f:event type="preRenderView" listener="#{manager.invalidateActiveSession}" />
</f:metadata>
This listener simply invalidates the session (if it exists):
HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(false);
if (session != null ) {
synchronized( session ) {
session.invalidate();
}
}
And this is what is causing the strange behavior. This same code works fine on GlassFish.
I've changed the code to, additionally, verify if the Principal is also not null.
I want to rewrite my yii application urls ,i just doen it and it works fine in my local machine . but when i move to server it is not working and shows a 500 Internal Server error
My current url is like this
cvdb.example.com/index.php/list/index
i want to rewrite it as
cvdb.example.com/list/index
Here is my code in config/main.php
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
And here is my .htaccess code
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
Here what i get when i put var_dumb($_SERVER)
array(39) {
["DOCUMENT_ROOT"]=>
string(29) "/home/bridge/public_html/cvdb"
["GATEWAY_INTERFACE"]=>
string(7) "CGI/1.1"
["HTTP_ACCEPT"]=>
string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
["HTTP_ACCEPT_LANGUAGE"]=>
string(14) "en-US,en;q=0.5"
["HTTP_CONNECTION"]=>
string(5) "close"
["HTTP_COOKIE"]=>
string(339) "fbm_1=base_domain=.cvdb.example.com; PHPSESSID=a6b697793d5abf01012435cf868a2f13; 52862fa7c29cebef614e5f38c01514c2=5571bdfdfdfdfdfdfb1ed61d4cae29f6145035a37a9d4ee45e83a%3A4%3A%7Bi%3A0%3Bs%3A1%3A%221%22%3Bi%3A1%3Bs%3A13%3A%22Administrator%22%3Bi%3A2%3Bi%3A31536000%3Bi%3A3%3Ba%3A1%3A%7Bs%3A4%3A%22role%22%3Bs%3A2%3A%2210%22%3B%7D%7D"
["HTTP_HOST"]=>
string(23) "cvdb.example.com"
["HTTP_USER_AGENT"]=>
string(72) "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0"
["HTTP_X_FORWARDED_FOR"]=>
string(14) "220.336.5.3"
["HTTP_X_FORWARDED_HOST"]=>
string(23) "cvdb.example.com"
["HTTP_X_FORWARDED_SERVER"]=>
string(23) "cvdb.example.com"
["HTTP_X_REAL_IP"]=>
string(14) "220.336.5.3"
["PATH"]=>
string(13) "/bin:/usr/bin"
["PHPRC"]=>
string(13) "/home/bridge/"
["QUERY_STRING"]=>
string(0) ""
["REDIRECT_PHPRC"]=>
string(13) "/home/bridge/"
["REDIRECT_STATUS"]=>
string(3) "200"
["REDIRECT_UNIQUE_ID"]=>
string(24) "UtTWkTIfkzwAAddfdFUWCbwAAAAD"
["REDIRECT_URL"]=>
string(11) "/list/index"
["REMOTE_ADDR"]=>
string(14) "220.227.90.185"
["REMOTE_PORT"]=>
string(5) "43681"
["REQUEST_METHOD"]=>
string(3) "GET"
["REQUEST_URI"]=>
string(11) "/list/index"
["SCRIPT_FILENAME"]=>
string(39) "/home/bridge/public_html/cvdb/index.php"
["SCRIPT_NAME"]=>
string(10) "/index.php"
["SERVER_ADDR"]=>
string(12) "50.31.147.60"
["SERVER_ADMIN"]=>
string(33) "webmaster#cvdb.example.com"
["SERVER_NAME"]=>
string(23) "cvdb.example.com"
["SERVER_PORT"]=>
string(2) "80"
["SERVER_PROTOCOL"]=>
string(8) "HTTP/1.0"
["SERVER_SIGNATURE"]=>
string(0) ""
["SERVER_SOFTWARE"]=>
string(156) "Apache/2.2.25 (Unix) mod_ssl/2.2.25 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_python/3.3.1 Python/2.4.3 mod_jk/1.2.37 mod_bwlimited/1.4 mod_perl/2.0.6 Perl/v5.8.8"
["UNIQUE_ID"]=>
string(24) "UtTWkTIfkzwAAFUWCbwAAAAD"
["ORIG_PATH_INFO"]=>
string(11) "/list/index"
["ORIG_PATH_TRANSLATED"]=>
string(39) "/home/bridge/public_html/cvdb/index.php"
["PHP_SELF"]=>
string(10) "/index.php"
["REQUEST_TIME"]=>
int(1389680273)
["argv"]=>
array(0) {
}
["argc"]=>
int(0)
}
try this
<ifModule mod_rewrite.c>
# Turn on the engine:
RewriteEngine on
# Don't perform redirects for files and directories that exist:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# For everything else, redirect to index.php:
RewriteRule . index.php
</ifModule>
Or just try removing this line simply from your .htaccess file
RewriteBase /
hopefully someone can help, i've been trying to set up nginx with virtual hosts but the default host always overrides any of the others that i specify.
here is my config file found in /etc/nginx/sites-enabled
server {
listen 80;
server_name sub.example.com;
return 404;
}
server {
listen 80 default;
server_name *.example.com;
return 501;
}
and the access.log shows
*.*.*.* - - [30/Oct/2013:04:09:11 +0400] "GET / HTTP/1.1" 501 582 "http://sub.example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36"
*.*.*.* - - [30/Oct/2013:04:09:14 +0400] "GET / HTTP/1.1" 501 582 "http://www.example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36"
thanks in advance for any help / ideas.
Ant