ColibriSM蜂鸟SM伪静态教程(Nginx)

浏览: 0 2024-02-08 23:15:29

打开网站伪静态设置

输入一下代码即可

# Delete this comment and copy all the code from this 
# file into the main Nginx web server file (/etc/nginx/nginx.conf) 
# following our instructions for installing the script


location /404 {
    rewrite ^/404(\/|)$ /index.php?app=err404;
}

location /500 {
    rewrite ^/500(\/|)$ /index.php?app=err500;
}

location /feed {
    rewrite ^/feed(\/|)$ /index.php?app=feed;
}

location /premium_account {
    rewrite ^/premium_account(\/|)$ /index.php?app=premium_account;
}

location /feed_preferences {
    rewrite ^/feed_preferences(\/|)$ /index.php?app=feed_preferences;
}

location /subscriptions {
    rewrite ^/subscriptions(\/|)$ /index.php?app=subscriptions;
}

location /premium_features {
    rewrite ^/premium_features(\/|)$ /index.php?app=premium_features;
}

location /wallet_add {
    rewrite ^/wallet_add(\/|)$ /index.php?app=wallet_add;
}

location /wallet_send {
    rewrite ^/wallet_send(\/|)$ /index.php?app=wallet_send;
}

location /download_info {
    rewrite ^/download_info(\/|)$ /index.php?app=download_info;
}

location /native_api {
    rewrite "^/native_api/(\w{3,32})/(\w{3,32})$" /api.php?api=native&app=$1&action=$2;
}

location /mobile_api {
    rewrite "^/mobile_api/(\w{3,32})$" /api.php?api=mobile&app=$1;
}

location /language{
    rewrite "^/language/(\w{2,25})(\/|)$" /index.php?app=home&language=$1;
}

location /guest {
    rewrite ^/guest(\/|)$ /index.php?app=guest;
}

location /confirm_registration {
    rewrite ^/confirm_registration(\/|)$ /index.php?app=confirm_reg;
}

location /confirm_email {
    rewrite ^/confirm_email(\/|)$ /index.php?app=confirm_email;
}

location /confirm_phone {
    rewrite ^/confirm_phone(\/|)$ /index.php?app=confirm_phone;
}

location /admin_panel {
    rewrite ^/admin_panel(\/|)$ /index.php?app=cpanel;
    rewrite "^/admin_panel/(\w{3,25})(\/|)$" /index.php?app=cpanel&section=$1;
}  

location /bookmarks {
    rewrite ^/bookmarks(\/|)$ /index.php?app=bookmarks;
}  

location /notifications {
    rewrite ^/notifications(\/|)$ /index.php?app=notifications&page=notifs;
}  

location /mentions {
    rewrite ^/mentions(\/|)$ /index.php?app=notifications&page=mentions;
}  

location /search {
    rewrite ^/search(\/|)$ /index.php?app=explore;
    rewrite ^/search/(htags|people|posts)(\/|)$ /index.php?app=explore&tab=$1;
}

location /explore {
  rewrite ^/explore(\/|)$ /index.php?app=explore;
  rewrite ^/explore/(htags|people|posts)(\/|)$ /index.php?app=explore&tab=$1;
}

location /start_up {
    rewrite ^/start_up(\/|)$ /index.php?app=start_up;
}  

location /thread {
    rewrite "^/thread/([0-9]{1,11})(\/|)$" /index.php?app=thread&thread_id=$1;
}  

location /reset_password {
    rewrite ^/reset_password(\/|)$ /index.php?app=guest;
} 

location /home {
    rewrite ^/home(\/|)$ /index.php?app=home;
}  

location /logout {
    rewrite ^/logout(\/|)$ /index.php?app=logout;
}  

location /settings {
    rewrite ^/settings(\/|)$ /index.php?app=settings;
    rewrite "^/settings/(\w{3,25})(\/|)$" /index.php?app=settings&sapp=$1;
    rewrite "^/settings/(\w{3,25})/(\w{3,25})(\/|)$" /index.php?app=settings&sapp=$1&stab=$2;
}  

location /wallet {
    rewrite ^/wallet(\/|)$ /index.php?app=wallet;
}  

location /terms_of_use {
    rewrite ^/terms_of_use(\/|)$ /index.php?app=stat_pages&page=terms;
}  

location /privacy_policy {
    rewrite ^/privacy_policy(\/|)$ /index.php?app=stat_pages&page=privacy_policy;
}  

location /cookies_policy {
    rewrite ^/cookies_policy(\/|)$ /index.php?app=stat_pages&page=cookies_policy;
} 

location /about_us {
    rewrite ^/about_us(\/|)$ /index.php?app=stat_pages&page=about_us;
}  

location /faqs {
    rewrite ^/faqs(\/|)$ /index.php?app=stat_pages&page=faqs;
}  

location /suggested {
    rewrite ^/suggested(\/|)$ /index.php?app=suggested;
}  

location /chats {
    rewrite ^/chats(\/|)$ /index.php?app=chats;
}  

location /affiliates {
    rewrite ^/affiliates(\/|)$ /index.php?app=affiliates;
}  

location /ads {
    rewrite ^/ads(\/|)$ /index.php?app=ads;
    rewrite ^/ads/new(\/|)$ /index.php?app=ads&page=upsert;
    rewrite ^/ads/archive(\/|)$ /index.php?app=ads&page=archive;
    rewrite ^/ads/pending(\/|)$ /index.php?app=ads&page=pending;
    rewrite ^/ads/edit/(\d+)(\/|)$ /index.php?app=ads&page=upsert&ad_id=$1;
    rewrite ^/ads/(\d+)(\/|)$ /index.php?app=ad_item&ad_id=$1;
}  

location /oauth {
  rewrite ^/oauth(\/|)$ /index.php?app=oauth;
  rewrite ^/oauth/twitter(\/|)$ /index.php?app=oauth&provider=twitter;
  rewrite ^/oauth/google(\/|)$ /index.php?app=oauth&provider=google;
  rewrite ^/oauth/facebook(\/|)$ /index.php?app=oauth&provider=facebook;
  rewrite ^/oauth/linkedin(\/|)$ /index.php?app=oauth&provider=linkedin;
  rewrite ^/oauth/discord(\/|)$ /index.php?app=oauth&provider=discord;
  rewrite ^/oauth/vkontakte(\/|)$ /index.php?app=oauth&provider=vkontakte;
  rewrite ^/oauth/instagram(\/|)$ /index.php?app=oauth&provider=instagram;
}

location /conversation {
    rewrite "^/conversation/(\w{3,25})(\/|)$" /index.php?app=conversation&uname=$1;
}

location /wallet_bank_transfer {
    rewrite "^/wallet_bank_transfer/(\w{36})(\/|)$" /index.php?app=wallet_banktrans&sid=$1;
}

location / {
    if (!-e $request_filename){
        rewrite ^/$ /index.php?app=home;
    }

    if (!-e $request_filename){
        rewrite "^/(\w{3,25})(\/|)$" /index.php?app=profile&uname=$1;
        rewrite "^/(\w{3,25})/(following|followers)(\/|)$" /index.php?app=connections&uname=$1&tab=$2;
        rewrite "^/(\w{3,25})/(posts|media|likes)(\/|)$" /index.php?app=profile&uname=$1&tab=$2;
    }
} 

location ~ /\.ht {
    deny all;
}

image