Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
noblogs-wp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai
noblogs-wp
Commits
50bfd04a
Commit
50bfd04a
authored
7 years ago
by
ale
Committed by
lucha
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Switch apache2-noblogs port to :92
parent
f7a9ce16
No related branches found
Tags
noblogs-4.8.3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wp-nginx-map.php
+6
-3
6 additions, 3 deletions
wp-nginx-map.php
with
6 additions
and
3 deletions
wp-nginx-map.php
+
6
−
3
View file @
50bfd04a
...
...
@@ -11,6 +11,9 @@ $noblogs_master = parse_url($master_url)['host'];
define
(
'WP_CACHE'
,
false
);
require_once
(
'/opt/noblogs/www/wp-load.php'
);
// Port that the noblogs apache2 instance is listening on (as a string).
define
(
'NOBLOGS_PORT'
,
'92'
);
// Return all blogs.
function
get_blogs
()
{
global
$wpdb
;
...
...
@@ -26,10 +29,10 @@ 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
$noblogs_master
.
':
82'
;
return
$noblogs_master
.
':
'
.
NOBLOGS_PORT
;
}
$id
=
substr
(
$backend
,
8
);
return
'172.16.1.'
.
$id
.
':
82'
;
return
'172.16.1.'
.
$id
.
':
'
.
NOBLOGS_PORT
;
}
// Print the blog -> backend map.
...
...
@@ -39,7 +42,7 @@ function generate_backend_map($blogs) {
$wpdb_hash
=
&
$wpdb
->
hash_map
;
printline
(
'map $http_host $backend_noblogs {'
);
printline
(
' default http://'
.
$noblogs_master
.
':
82
;'
);
printline
(
' default http://'
.
$noblogs_master
.
':
'
.
NOBLOGS_PORT
.
'
;'
);
foreach
(
$blogs
as
$blog
)
{
$blog_id
=
$blog
->
blog_id
;
if
(
$blog_id
==
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment