80番ポートとは、インターネットなどの通信でアプリケーションの種類や通信規約(プロトコル)の識別に用いられるポート番号の一つ。通常はTCPの80番をWebサーバがHTTPでWebブラウザなどと通信するために用いる。
//IT用語辞典
又SSL/TLSを併用してHTTPSとして通信する場合は80番ではなく443番ポートが標準となっている。
$ ln -s /etc/nginx/sites-available/webServer80 /etc/nginx/sites-enabled/
$ sudo nano /etc/nginx/sites-available/webServer80
//コピへして自分の環境に合わせて修正してください
#signpost HTTP(80)
server {
listen 80; #80番のポートを使います宣言
server_name signpost; #Webサイトの名前
access_log /mnt/NAS/WebSite/other/logs/signpost_access.log; # access_logをしまう場所
error_log /mnt/NAS/WebSite/other/logs/signpost_error.log; # error_log をしまう場所
location / {
root /mnt/NAS/WebSite/signpost/; # Webサイト(index)を置いてある場所
index index.html index.php; # indexの拡張子を読み込む順番
}
}
#ashitahe HTTP(80)
server {
listen 80;
server_name ashitahe;
access_log /mnt/NAS/WebSite/other/logs/ashitahe_access.log;
error_log /mnt/NAS/WebSite/other/logs/ashitahe_error.log;
root /mnt/NAS/WebSite/ashitahe/;
index index.php index.html; # wpはphp使用の為、index.phpが前の順番
# wordpress パーマネントリンク設定
try_files $uri $uri/ /index.php?q=$uri&$args;
# wp-config.phpへのアクセス拒否設定
location ~* /wp-config.php {
deny all;
}
# php-fpm用設定
location ~ \.php$ {
#include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
}