質問編集履歴

6

追記

2021/04/06 06:20

投稿

Testhoge
Testhoge

スコア10

test CHANGED
File without changes
test CHANGED
@@ -247,3 +247,35 @@
247
247
 
248
248
 
249
249
  ```
250
+
251
+ ご指摘頂いた情報を追記いたします。
252
+
253
+ portの状況とufw(ubuntu fire wall)の状態です。
254
+
255
+ firewallは現在のところ稼働させておりません(セキュリティ的には良くないのですが)
256
+
257
+ ```
258
+
259
+ #ufwの確認
260
+
261
+ sudo ufw status
262
+
263
+ [sudo] password for penguin:
264
+
265
+ Status: inactive
266
+
267
+ #portの状況
268
+
269
+ sudo lsof | grep "8000"
270
+
271
+
272
+
273
+ nginx 179409 root 6u IPv4 1121029 0t0 TCP *:8000 (LISTEN)
274
+
275
+ nginx 179410 www-data 6u IPv4 1121029 0t0 TCP *:8000 (LISTEN)
276
+
277
+
278
+
279
+
280
+
281
+ ```

5

追記

2021/04/06 06:20

投稿

Testhoge
Testhoge

スコア10

test CHANGED
File without changes
test CHANGED
@@ -185,3 +185,65 @@
185
185
 
186
186
 
187
187
  ```
188
+
189
+ ローカルの組み込みサーバでの状況とnginx環境の比較を追記します。
190
+
191
+ 色々抜けていてすいません。
192
+
193
+ ```
194
+
195
+ #ローカル環境(上手くいった)でのリクエスト
196
+
197
+ penguin@ubuntu ~> curl -i 'localhost:8000/api/csrf-cookie'
198
+
199
+ HTTP/1.1 204 No Content
200
+
201
+ Host: localhost:8000
202
+
203
+ Date: Tue, 06 Apr 2021 05:38:57 GMT
204
+
205
+ Connection: close
206
+
207
+ X-Powered-By: PHP/7.4.3
208
+
209
+ Cache-Control: no-cache, private
210
+
211
+ Date: Tue, 06 Apr 2021 05:38:57 GMT
212
+
213
+ Set-Cookie: XSRF-TOKEN=eyJpdiI6IjFiWEt2SHkxUWpQMC9pZVU2MzA2WWc9PSIsInZhbHVlIjoib2J3WFZuSHBUUjA1Nkc3YTZ2czRKYnlnTmFrKzJUa2NxYU9zcmZ5dStzMm5VYk5zZnFGaGJnbnRTTFBZRHhLNHJDQlJXdG5hMEF0T3g1RmMybjVGWHAwZVdQcno5RDJMUVJaYU1vTHV1a1lXS2p6WlhLTk82UW9aVFlhUWNoUE4iLCJtYWMiOiI3MDUzYTI0YTJjNDJiNTUyZTQxZTRhMmRhMzg2NTQwNDFiYjk2ZDk5MDU0YWNlMWQ4YzU0OTQ1NTI4NWYyYzU5In0%3D; expires=Tue, 06-Apr-2021 07:38:57 GMT; Max-Age=7200; path=/; domain=localhost; samesite=lax
214
+
215
+ Set-Cookie: laravel_session=eyJpdiI6ImpCOUhxa2N1bFZYcnZ0Rnc2bXk0SVE9PSIsInZhbHVlIjoiczRoWmMyS3pYM1VnS05hL3NMdnFjMmY1b2V0UE12cGZDUUhmMzhxRG9uK095SkM5amJOaTJrVlJoWCs4cHVWM051VmNxSFdRZHBoT3JzelNlb1EvTVBBZXlsVHdES1VhSWsyZmlnVGgvQUhBNFZHNFlMQmZqeDF1MVVQWk5abHEiLCJtYWMiOiIxZDMzN2EwNDEzMjY2ZGJjODQ0MDllYTFiMTFiMTNkNGU2ZWEzOTljZTUwMDFkMjY3OWVlMDNjYWFhMDQ0MThkIn0%3D; expires=Tue, 06-Apr-2021 07:38:57 GMT; Max-Age=7200; path=/; domain=localhost; httponly; samesite=lax
216
+
217
+ Set-Cookie: 5cg4jvkegDs0XvO9qFOHLa4jrPfnZoLZs9imh1uV=eyJpdiI6ImVTeUQ2bFRuUXJSbEF0cHQxLzFVVGc9PSIsInZhbHVlIjoidDVxK1UzT2ttVTB6d1R4MVZFTGlta3dRZ0tIdC8vc1BvWms5cDBGQThPaWxJK2VhSFovTTV4RXlqcTVDZ2Q4YlptNzl0SGU2bExybmlPUzk5dlJ3dTJWOHpJb1NvNzlGbG5idVJTMGRDWVhOdTVkRlJGeXB6Rnh2NDVMOWlqRXNLU09nVGd0VWkvYjNmM0Z5QnBXWWpEVVJBanJTNzlQMWJoTnpMbHVzcnBPNmFLTFlrRFNXMUdJb0dicm00Y2g5ODY3TlZmYlIrRXJXek4xbyt6aDcwWEM4L2ErSVIxQVpuUnFrZXhLKzRFYTFJRlZpYWRxa2dTWEtISmRMTVJCcUc2SzlNazkyMmcyT0lLVHQxd2ZYdGoxZ2ZSZTNZU09pSGZNa3dZZlRObVU5azRPcHRYcHlFL2xBbkxKK1dPeVNvaGVxdGYzZXRPSGhmdXFJYnJzbDV6WjZpS0xkajRmQlhmTGkwTUdIblZwazdNb3Y0Z1RNOFhjNjNqZ1haS0JLaXBSQ2k4UHI1Ty9qZG9Ga1NmRWRVUT09IiwibWFjIjoiNTMzYzg4ODA1ZDJjYWJjZTJhMzhhMzIwNmViNDljM2YwMDdhNmRjYmZiZDgyNWI3NGUzMThmNTYyNjcxMzcwZSJ9; expires=Tue, 06-Apr-2021 07:38:57 GMT; Max-Age=7200; path=/; domain=localhost; httponly; samesite=lax
218
+
219
+
220
+
221
+ #nginx環境でのリクエスト
222
+
223
+ penguin@ubuntu-s-testapp /e/n/sites-available>
224
+
225
+ curl -i 'http://example.com:8000/api/csrf-cookie'
226
+
227
+ HTTP/1.1 204 No Content
228
+
229
+ Server: nginx/1.18.0 (Ubuntu)
230
+
231
+ Date: Tue, 06 Apr 2021 05:45:37 GMT
232
+
233
+ Connection: keep-alive
234
+
235
+ Access-Control-Allow-Origin: *
236
+
237
+ Access-Control-Allow-Methods: GET, POST, PUT, DELETE
238
+
239
+ Access-Control-Allow-Headers: Origin, Authorization, Accept, Content-Type
240
+
241
+ Access-Control-Max-Age: 3600
242
+
243
+ Content-Type: text/plain charset=UTF-8
244
+
245
+ Content-Length: 0
246
+
247
+
248
+
249
+ ```

4

質問ミス

2021/04/06 05:47

投稿

Testhoge
Testhoge

スコア10

test CHANGED
File without changes
test CHANGED
@@ -128,7 +128,9 @@
128
128
 
129
129
  すいません。fpmとnginxのログを追記します。
130
130
 
131
+ ```
132
+
131
- ```/var/log/php7.4-fpm.log.1
133
+ #/var/log/php7.4-fpm.log.1
132
134
 
133
135
  [29-Mar-2021 00:46:57] NOTICE: fpm is running, pid 77741
134
136
 
@@ -152,7 +154,9 @@
152
154
 
153
155
 
154
156
 
157
+ ```
158
+
155
- ``` /var/log/nginx/error.log.1
159
+ #/var/log/nginx/error.log.1
156
160
 
157
161
  #修正済
158
162
 
@@ -162,7 +166,9 @@
162
166
 
163
167
 
164
168
 
169
+ ```
170
+
165
- ```/var/log/nginx/access.log.1
171
+ #/var/log/nginx/access.log.1
166
172
 
167
173
  127.0.0.1 - - [05/Apr/2021:08:47:04 +0000] "GET /api/csrf-cookie HTTP/1.1" 204 0 "-" "curl/7.68.0"
168
174
 

3

php-fpmのログとnginxのログの追記

2021/04/06 02:58

投稿

Testhoge
Testhoge

スコア10

test CHANGED
File without changes
test CHANGED
@@ -121,3 +121,61 @@
121
121
 
122
122
 
123
123
  どうかわかる方いらしましたらよろしくお願いいたします。
124
+
125
+
126
+
127
+ =追記=
128
+
129
+ すいません。fpmとnginxのログを追記します。
130
+
131
+ ```/var/log/php7.4-fpm.log.1
132
+
133
+ [29-Mar-2021 00:46:57] NOTICE: fpm is running, pid 77741
134
+
135
+ [29-Mar-2021 00:46:57] NOTICE: ready to handle connections
136
+
137
+ [29-Mar-2021 00:46:57] NOTICE: systemd monitor interval set to 10000ms
138
+
139
+ [29-Mar-2021 00:46:57] NOTICE: Terminating ...
140
+
141
+ [29-Mar-2021 00:46:57] NOTICE: exiting, bye-bye!
142
+
143
+ [29-Mar-2021 00:46:57] NOTICE: fpm is running, pid 77837
144
+
145
+ [29-Mar-2021 00:46:57] NOTICE: ready to handle connections
146
+
147
+ [29-Mar-2021 00:46:57] NOTICE: systemd monitor interval set to 10000ms
148
+
149
+
150
+
151
+ ```
152
+
153
+
154
+
155
+ ``` /var/log/nginx/error.log.1
156
+
157
+ #修正済
158
+
159
+ 2021/04/05 14:39:50 [emerg] 171536#171536: "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/example.conf:30
160
+
161
+ ```
162
+
163
+
164
+
165
+ ```/var/log/nginx/access.log.1
166
+
167
+ 127.0.0.1 - - [05/Apr/2021:08:47:04 +0000] "GET /api/csrf-cookie HTTP/1.1" 204 0 "-" "curl/7.68.0"
168
+
169
+ my_remote_address - - [05/Apr/2021:08:47:26 +0000] "GET /api/csrf-cookie HTTP/1.1" 204 0 "-" "curl/7.68.0"
170
+
171
+ my_remote_address - - [05/Apr/2021:08:47:36 +0000] "GET /api/csrf-cookie HTTP/1.1" 204 0 "-" "curl/7.68.0"
172
+
173
+ my_remote_address - - [05/Apr/2021:08:47:50 +0000] "GET /api/csrf-cookie HTTP/1.1" 204 0 "-" "curl/7.68.0"
174
+
175
+ my_remote_address - - [05/Apr/2021:08:50:31 +0000] "GET /api/csrf-cookie HTTP/1.1" 204 0 "-" "curl/7.68.0"
176
+
177
+ my_address - - [05/Apr/2021:08:50:44 +0000] "GET /api/csrf-cookie HTTP/1.1" 204 0 "-" "curl/7.68.0"
178
+
179
+
180
+
181
+ ```

2

質問ミス

2021/04/06 02:56

投稿

Testhoge
Testhoge

スコア10

test CHANGED
File without changes
test CHANGED
@@ -110,6 +110,14 @@
110
110
 
111
111
  ```
112
112
 
113
+ また、curl -i 'http://www.example.com:8000/'を公開したubuntu上で打ってみたところ
114
+
115
+ vueで記述したファイルは公開できているみたいです。
116
+
117
+
118
+
113
119
  php-fpmはインストール済みです。
114
120
 
121
+
122
+
115
123
  どうかわかる方いらしましたらよろしくお願いいたします。

1

質問ミス

2021/04/05 14:03

投稿

Testhoge
Testhoge

スコア10

test CHANGED
File without changes
test CHANGED
@@ -5,6 +5,8 @@
5
5
 
6
6
 
7
7
  デプロイする前のlocalhostの環境では
8
+
9
+ php artisan serveで動いてる組み込みサーバ上で
8
10
 
9
11
  "GET /api/csrf-cookie HTTP/1.1"
10
12