Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ai
noblogs-wp
Commits
81b3734d
Commit
81b3734d
authored
Nov 13, 2011
by
Joe
Committed by
agata
Jul 01, 2020
Browse files
small corrections to wp-nginx-map.php
parent
02399f88
Changes
1
Hide whitespace changes
Inline
Side-by-side
wp-nginx-map.php
View file @
81b3734d
...
...
@@ -3,7 +3,8 @@
// wp-nginx-map.php
//
// Stampa una mappa delle assegnazioni blog -> backend, per NGINX.
// IP interno del master.
define
(
'NOBLOGS_MASTER'
,
'172.16.1.10'
);
// Load wordpress api.
define
(
'WP_CACHE'
,
false
);
...
...
@@ -24,7 +25,7 @@ function printline($s) {
function
backend_to_http_endpoint
(
$backend
)
{
if
(
substr
(
$backend
,
0
,
8
)
!=
'backend_'
)
{
error_log
(
'diamine, di questo backend non so che farmene: '
.
$backend
);
return
'localhost
:82'
;
return
NOBLOGS_MASTER
.
'
:82'
;
}
$id
=
substr
(
$backend
,
8
);
return
'172.16.1.'
.
$id
.
':82'
;
...
...
@@ -38,7 +39,7 @@ function generate_map() {
$blogs
=
get_blogs
();
printline
(
'map $http_host $backend_noblogs {'
);
printline
(
' default http://
localhost
:82;'
);
printline
(
' default http://
'
.
NOBLOGS_MASTER
.
'
:82;'
);
foreach
(
$blogs
as
$blog
)
{
$blog_id
=
$blog
->
blog_id
;
$backend_id
=
$wpdb_hash
->
lookup
(
$blog_id
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment