The implementation of the micro engine, the base URL is adjusted to: /cmmpmain/web/index.php implementation
1. The deployment of Weiqing, the home URL at this stage is:https://cmpmain.xxx.com. Its base url is: /web/index.php. as shown in Figure 1
2. The deployment of Weiqing, I hope to adjust it, its home url is:https://front.xxx.com. To ensure that the domain names of all products are unified. Its base url is: /cmpmain/web/index.php.
3. The nginx configuration file is as follows
server {
listen 80;
charset utf-8;
root /mcloud/cmp_main/;
index index.php;
location /ncove/ {
rewrite ^/ncove/(\d+)-(\d+)$ /app/index.php?i=$1&c=entry&tenantId=QYWX_YQ_TENANTID&link_id=$2&scope=snsapi_userinfo&do=index&m=thirdlink_generate permanent;
}
location ~/*\.txt$ {
root /mcloud/cmp_main/attachment/txt;
}
location = /meepo_bigerwall/shake{
#default_type 'text/html';
#lua_code_cache off;
content_by_lua_file /etc/nginx/shake.lua;
}
location = /meepo_bigerwall/fksq{
#default_type 'application/json';
#lua_code_cache off;
content_by_lua_file /etc/nginx/fksq.lua;
}
location / {
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
}
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /mcloud/cmp_main/$fastcgi_script_name;
include fastcgi_params;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
location ~ ^/(status|ping)$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
access_log off;
allow 127.0.0.1;
allow 10.42.0.0/16;
allow 10.244.0.0/16;
deny all;
}
}
4. Decide to migrate /mcloud/cmp_main/ to /mcloud/cmp_main/cmpmain/.
5. Edit the nginx configuration file as follows
server {
listen 80;
charset utf-8;
root /mcloud/cmp_main/;
index index.php;
location /cmpmain/ncove/ {
rewrite ^/cmpmain/ncove/(\d+)-(\d+)$ /cmpmain/app/index.php?i=$1&c=entry&tenantId=QYWX_YQ_TENANTID&link_id=$2&scope=snsapi_userinfo&do=index&m=thirdlink_generate permanent;
}
location ~/*\.txt$ {
root /mcloud/cmp_main/cmpmain/attachment/txt;
}
location = /cmpmain/meepo_bigerwall/shake{
#default_type 'text/html';
#lua_code_cache off;
content_by_lua_file /etc/nginx/shake.lua;
}
location = /cmpmain/meepo_bigerwall/fksq{
#default_type 'application/json';
#lua_code_cache off;
content_by_lua_file /etc/nginx/fksq.lua;
}
location / {
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?url=$1 last;
break;
}
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /mcloud/cmp_main/$fastcgi_script_name;
include fastcgi_params;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}
6. Access static resource files:https://front.xxx.com/cmpmain/web/resource/js/lib/jquery.caret.js, the response is successful. as shown in Figure 2
7. Access dynamic files:https://front.xxx.com/cmpmain/web/index.php?c=utility&a=tenantids&tenantid=channel, the response is successful. as shown in Figure 3
8. Edit the public account, submit the form data, and the response is successful. in line with expectations. as shown in Figure 4



