向诚

向诚

巷子里的猫很自由,却没有归宿。
telegram
email

Modify the backend entrance of Mix Space

In the Extension Content of the support documentation on Mix Space, the backend system is accessed through a reverse proxy. It is not possible to change the backend path directly from the backend. However, if we modify the reverse proxy configuration and reverse proxy the original backend address again, we can achieve the effect of modifying the backend entry.

The following content is only applicable to the reverse proxy configuration of the backend layer with dual domain names. Please study the configuration file for single domain names separately.

location ^~ /new-backend-entry {
    proxy_pass http://127.0.0.1:2333/proxy/qaqdmin; 
    proxy_set_header Host $host; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header REMOTE-HOST $remote_addr; 
    add_header X-Cache $upstream_cache_status; 
}

Since the /qaqadmin in the backend seems to be unable to function properly after the update to version 6.0.0 of Mix Space, we use proxy/qaqadmin for reverse proxy here.

Of course, if we only reverse proxy the backend entry, the original entry can still be used normally and will not be hidden. Therefore, we need to continue modifying the reverse proxy configuration to block the original entry.

location ^~ /proxy/qaqdmin {
    deny all; 
}
location ^~ /qaqdmin {
    deny all; 
}

The complete reverse proxy configuration is as follows:

location ^~ /socket.io {
    proxy_pass http://127.0.0.1:2333/socket.io; 
    proxy_set_header Host $host; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header REMOTE-HOST $remote_addr; 
    proxy_set_header Upgrade $http_upgrade; 
    proxy_set_header Connection "upgrade"; 
    proxy_buffering off; 
    proxy_http_version 1.1; 
    add_header Cache-Control no-cache; 
    add_header Strict-Transport-Security "max-age=31536000"; 
}
location ^~ / {
    proxy_pass http://127.0.0.1:2333; 
    proxy_set_header Host $host; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header REMOTE-HOST $remote_addr; 
    add_header X-Cache $upstream_cache_status; 
}
location ^~ /proxy/qaqdmin {
    deny all; 
}
location ^~ /qaqdmin {
    deny all; 
}
location ^~ /new-backend-entry {
    proxy_pass http://127.0.0.1:2333/proxy/qaqdmin; 
    proxy_set_header Host $host; 
    proxy_set_header X-Real-IP $remote_addr; 
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
    proxy_set_header REMOTE-HOST $remote_addr; 
    add_header X-Cache $upstream_cache_status; 
}

Note that since the backend login operation of the Shiro theme relies on the backend system setting - the management backend address set in the website settings for redirection, when you reverse proxy a new backend, you need to modify the management backend address in the settings, otherwise the Shiro front end will not be redirected to the backend normally when using functions such as Dashboard or Editor.

This article is synchronized updated to xLog by Mix Space
The original link is https://de3ay.com/posts/tech/mixspace-chage-dashboard-path


Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.