国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目

這篇具有很好參考價值的文章主要介紹了銀河麒麟服務(wù)器v10 sp1 nginx 部署項目。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

上一篇:銀河麒麟服務(wù)器v10 sp1 nginx開機自動啟動_csdn_aspnet的博客-CSDN博客

?由于項目為前后端分離,前端項目使用nginx部署,VUE項目打包后上傳至銀河麒麟服務(wù)器:

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10

8063 為前端項目文件目錄,修改配置?,默認配置沒有處理:

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10

?sudo systemctl stop?nginx.service

?sudo systemctl status nginx.service

sudo systemctl start?nginx.service

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10?

異常信息:Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

開始以為是配置文件的問題,然而在本機測試是可以正常啟動,于是開始查找端口是否占用問題:

?銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10

并沒有占用,還能是什么問題?使用 命令 sudo systemctl status nginx.service 看看能不能鎖定具體問題:

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10

明顯看到80端口被占用了,這才想到開始修改配置的時候默認80端口并沒有處理:

netstat -apn|grep :80

kill 58758 #殺死進程

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10

將配置文件下載到本機,修改后上傳服務(wù)器,配置如下:


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
	include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 50M;
    fastcgi_intercept_errors on;
    add_header X-Frame-Options SAMEORIGIN;
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    gzip on;
    gzip_static on;
    gzip_disable "msie6";
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;


    server {
        listen       8063;
        server_name  localhost;
        location / {
            root   html/8063;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
        }
        location ^~ /apis/ {
            proxy_pass http://127.0.0.1:8061/;
        }
        location ^~ /apiz/ {
            proxy_pass http://127.0.0.1:8071/;
        }
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

執(zhí)行命令:

sudo systemctl stop?nginx.service

?sudo systemctl status nginx.service

sudo systemctl start?nginx.service

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10

使用命令:sudo systemctl status nginx.service 查看具體錯誤:

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10

?nqinx: [emerg] unknown directive "gzip_static"

啟動異常:未知指令,于是將gzip_static on; 注釋 #gzip_static on;,再次執(zhí)行上面命令啟動:

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10

通過上圖看到已經(jīng)啟動成功,在瀏覽器訪問:

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10?

?難道是靜態(tài)文件沒有訪問權(quán)限,對8063目錄進行授權(quán)操作:

chmod 777 /usr/local/nginx1.25.1/html/8063

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10

再次訪問依然為500,于是開始查找資料:

1. 設(shè)置靜態(tài)網(wǎng)頁或者文件夾權(quán)限

chmod 755 /home/ubuntu/nginxPic/

2. nginx 配置文件,配置server

sudo vi /etc/nginx/nginx.conf

在http里面加sever

server {

listen 92.168.2.380;

server_name 1;

autoindex on; #是否允許訪問目錄

location / {

root html;

index index.html index.htm;

}

在server節(jié)點添加上面紅色部分:

server {
? ? ? ? listen ? ? ? 8063;
? ? ? ? server_name ?localhost;
?? ??? ?autoindex on; #是否允許訪問目錄
? ? ? ? location / {
? ? ? ? ? ? root ? html/8063;
? ? ? ? ? ? index ?index.html index.htm;
? ? ? ? ? ? try_files $uri $uri/ /index.html;
? ? ? ? }
? ? ? ? location ^~ /apis/ {
? ? ? ? ? ? proxy_pass http://127.0.0.1:8061/;
? ? ? ? }
? ? ? ? location ^~ /apiz/ {
? ? ? ? ? ? proxy_pass http://127.0.0.1:8071/;
? ? ? ? }
? ? }

停止,重新啟動nginx,依然沒有解決。查看配置到 root ? html/8063; 這一行的時候,在windows中會自動匹配到nginx下的html的目錄,將此路徑補全,由于代理獲取ip均為127.0.0.1或::1,在server的location節(jié)點下添加請求IP配置,完整配置如下:


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
	include       mime.types;
    default_type  application/octet-stream;
    client_max_body_size 50M;
    fastcgi_intercept_errors on;
    add_header X-Frame-Options SAMEORIGIN;
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    gzip on;
    #gzip_static on;
    gzip_disable "msie6";
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;


    server {
        listen       8063;
        server_name  localhost;
		autoindex on; #是否允許訪問目錄
        location / {
            root   /usr/local/nginx-1.25.1/html/8063;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
			proxy_set_header X-Real-IP $remote_addr;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
        location ^~ /apis/ {
            proxy_pass http://127.0.0.1:8061/;
        }
        location ^~ /apiz/ {
            proxy_pass http://127.0.0.1:8071/;
        }
    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

vue項目完整目錄:

root ? /usr/local/nginx-1.25.1/html/8063;

IP配置:

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

配置完成后啟動:

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10?

銀河麒麟服務(wù)器v10 sp1 nginx 部署項目,銀河麒麟V10 SP1,nginx,nginx,銀河麒麟服務(wù)器v10?

項目訪問也是成功的,希望對你有幫助。

?文章來源地址http://www.zghlxwxcb.cn/news/detail-605753.html

到了這里,關(guān)于銀河麒麟服務(wù)器v10 sp1 nginx 部署項目的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 銀河麒麟高級服務(wù)器v10 sp1 iso鏡像定制

    https://www.kylinos.cn/support/trial.html?pid=1 ? ? ?? 安裝選擇最小化安裝 1 虛擬機下掛載原版鏡像 1) 查看光盤是否已掛載 ls -l /dev/cdrom |grep cd 2) 將ISO所在的/dev/cdrom掛載到/media mount /dev/cdrom /media 2 安裝制作發(fā)行版的工具 yum -y install createrepo mkisofs isomd5sum rsync 3 同步光盤文件到制作ISO的

    2024年02月06日
    瀏覽(21)
  • 銀河麒麟服務(wù)器操作系統(tǒng) V10 SP1 開啟SSH服務(wù)

    銀河麒麟服務(wù)器操作系統(tǒng) V10 SP1 開啟SSH服務(wù)

    此處顯示已經(jīng)安裝了openssh。 如果此處沒有任何輸出顯示,表示沒有安裝openssh 當發(fā)現(xiàn)沒有安裝openssh時,使下面的命令安裝openssh: 如圖所示,已經(jīng)開啟sshd服務(wù)。 如果顯示未開啟sshd服務(wù),使用下列命令開啟sshd服務(wù) 使用下面的命令查看ssh服務(wù)是否開機啟動 如上圖所示,ssh已經(jīng)

    2023年04月22日
    瀏覽(34)
  • 銀河麒麟服務(wù)器 v10 sp1 安裝 .Net6.0

    銀河麒麟服務(wù)器 v10 sp1 安裝 .Net6.0

    系統(tǒng)版本、架構(gòu): ?如果系統(tǒng)自帶.netcore3,先卸載系統(tǒng)自帶的.netcore3: ?卸載.netcore3: 我的系統(tǒng)沒有自帶.netcore3,也沒有yum命令。 下載二進制文件安裝SDK: 下載 .NET 6.0 (Linux、macOS 和 Windows) 下載后將文件dotnet-sdk-6.0.411-linux-x64.tar.gz,上傳至銀河麒麟服務(wù)器: 我的第一步給文

    2024年02月12日
    瀏覽(44)
  • 銀河麒麟服務(wù)器v10 sp1 .Net6.0 上傳文件錯誤

    銀河麒麟服務(wù)器v10 sp1 .Net6.0 上傳文件錯誤

    上一篇:銀河麒麟服務(wù)器v10 sp1 部署.Net6.0 http https_csdn_aspnet的博客-CSDN博客 .NET 6之前,在Linux服務(wù)器上安裝 libgdiplus 即可解決,libgdiplus是System.Drawing.Common原生端跨平臺實現(xiàn)的主要提供者,是開源mono項目。地址:GitHub - mono/libgdiplus: C-based implementation of the GDI+ API 因此,解決方法

    2024年02月12日
    瀏覽(26)
  • 銀河麒麟V10SP1服務(wù)器系統(tǒng)同步外網(wǎng)源到本地

    系統(tǒng)環(huán)境:Kylin Linux Advanced Server release V10(SP1)/(Tercel)-aarch64-Build20/20210518 本文同步的是外網(wǎng)ARM的yum源倉庫,若需要同步X86的yum源倉庫,則需要修改yum配置文件的架構(gòu)為X86,其他配置不變。 a)確定系統(tǒng)版本及網(wǎng)絡(luò)情況 b)關(guān)閉系統(tǒng)防火墻和 selinux a)備份原yum配置文件 b)yum配

    2024年01月24日
    瀏覽(28)
  • 銀河麒麟服務(wù)器操作系統(tǒng) V10 SP1 防火墻(firewalld)指令

    銀河麒麟服務(wù)器操作系統(tǒng) V10 SP1 防火墻(firewalld)指令

    systemctl status firewalld (或者: systemctl status firewalld.service ,或者: systemctl is-active firewalld )active(running):表示防火墻已經(jīng)開啟。 1、開啟: systemctl start firewalld 查看狀態(tài): systemctl status firewalld 2、關(guān)閉: systemctl stop firewalld 查看狀態(tài): systemctl status firewalld 3、重啟: systemc

    2024年02月13日
    瀏覽(25)
  • 銀河麒麟服務(wù)器v10 sp1 部署 redis 及redis gui 客戶端工具

    銀河麒麟服務(wù)器v10 sp1 部署 redis 及redis gui 客戶端工具

    上一篇:銀河麒麟服務(wù)器v10 sp1 redis開機自動啟動_csdn_aspnet的博客-CSDN博客 本文介紹另一種redis安裝方式及客戶端工具安裝。 Redis 是一種內(nèi)存數(shù)據(jù)模型存儲,可用作數(shù)據(jù)庫、緩沖區(qū)和消息傳遞中繼。它是開源的(BSD 許可)。字符串、散列、列表、集合、具有范圍搜索的排序集

    2024年02月11日
    瀏覽(39)
  • 銀河麒麟服務(wù)器v10 sp1 部署.Net6.0項目后無法訪問靜態(tài)文件

    銀河麒麟服務(wù)器v10 sp1 部署.Net6.0項目后無法訪問靜態(tài)文件

    上一篇:銀河麒麟服務(wù)器v10 sp1 部署.Net6.0 http https_csdn_aspnet的博客-CSDN博客 由于本人項目直接從.NetCore3.1升級到.Net6.0的,請參考文章:NetCore3.1項目升級到Net6.0_vs2022 沒有startup_csdn_aspnet的博客-CSDN博客 雖然部署項目后,swagger與接口可以正常訪問,但是靜態(tài)文件,如html、css、j

    2024年02月12日
    瀏覽(27)
  • 銀河麒麟服務(wù)器V10SP1雙內(nèi)核更改低版本內(nèi)核為第一引導項

    需要保留新內(nèi)核的情況下使操作系統(tǒng)在下次啟動默認加載的是舊內(nèi)核。 1.1 UEFI傳統(tǒng)的Legacy BIOS啟動 grub引導文件路徑不一致,先需要查看系統(tǒng)是UEFI啟動還是傳統(tǒng)的Legacy BIOS啟動

    2024年02月03日
    瀏覽(23)
  • 遠程連接銀河麒麟高級服務(wù)器操作系統(tǒng)V10SP1的幾種方法(命令行遠程+圖形化遠程)

    遠程連接銀河麒麟高級服務(wù)器操作系統(tǒng)V10SP1的幾種方法(命令行遠程+圖形化遠程)

    服務(wù)端 OS環(huán)境:銀河麒麟高級服務(wù)器操作系統(tǒng)V10SP1(x86_64) 確認sshd服務(wù)處于運行狀態(tài) [root@localhost ~]# systemctl status sshd 確認防火墻已經(jīng)放行SSH服務(wù) [root@localhost ~]# firewall-cmd --list-all 備注:如果系統(tǒng)沒有放行ssh服務(wù),或者ssh端口號被修改,則需要重新放行ssh服務(wù)或者新的ssh端口

    2024年02月09日
    瀏覽(41)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包