質問編集履歴

6

追記

2019/03/25 12:58

投稿

RuqenRuqen
RuqenRuqen

スコア10

test CHANGED
File without changes
test CHANGED
@@ -235,3 +235,7 @@
235
235
 
236
236
 
237
237
  ```
238
+
239
+ 追記
240
+
241
+ 絶対URLで入力しましたがエラーは変わりませんでした。

5

追記

2019/03/25 12:58

投稿

RuqenRuqen
RuqenRuqen

スコア10

test CHANGED
File without changes
test CHANGED
@@ -39,3 +39,199 @@
39
39
 
40
40
 
41
41
  初心者でお手数ですが、よろしくお願いします。
42
+
43
+
44
+
45
+ 追記
46
+
47
+ http://b.fcsys.org/2015/07/enable-customization-index-page-for-nginx.html
48
+
49
+ こちらのサイトを参考にしてみたのですが、 https://imgur.com/a/5jAjBEw 404 Not Foundと表示されてしまいます。ファイルはしっかりセットしてあります。 https://imgur.com/a/OdoSUUL
50
+
51
+ ```config
52
+
53
+ ##
54
+
55
+ # You should look at the following URL's in order to grasp a solid understanding
56
+
57
+ # of Nginx configuration files in order to fully unleash the power of Nginx.
58
+
59
+ # http://wiki.nginx.org/Pitfalls
60
+
61
+ # http://wiki.nginx.org/QuickStart
62
+
63
+ # http://wiki.nginx.org/Configuration
64
+
65
+ #
66
+
67
+ # Generally, you will want to move this file somewhere, and start with a clean
68
+
69
+ # file but keep this around for reference. Or just disable in sites-enabled.
70
+
71
+ #
72
+
73
+ # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
74
+
75
+ ##
76
+
77
+
78
+
79
+ # Default server configuration
80
+
81
+ #
82
+
83
+ server {
84
+
85
+ listen 80 default_server;
86
+
87
+ listen [::]:80 default_server;
88
+
89
+
90
+
91
+ # SSL configuration
92
+
93
+ #
94
+
95
+ # listen 443 ssl default_server;
96
+
97
+ # listen [::]:443 ssl default_server;
98
+
99
+ #
100
+
101
+ # Note: You should disable gzip for SSL traffic.
102
+
103
+ # See: https://bugs.debian.org/773332
104
+
105
+ #
106
+
107
+ # Read up on ssl_ciphers to ensure a secure configuration.
108
+
109
+ # See: https://bugs.debian.org/765782
110
+
111
+ #
112
+
113
+ # Self signed certs generated by the ssl-cert package
114
+
115
+ # Don't use them in a production server!
116
+
117
+ #
118
+
119
+ # include snippets/snakeoil.conf;
120
+
121
+
122
+
123
+ root /var/www/html;
124
+
125
+
126
+
127
+ # Add index.php to the list if you are using PHP
128
+
129
+ index index.html index.htm index.nginx-debian.html;
130
+
131
+
132
+
133
+ server_name _;
134
+
135
+
136
+
137
+ location / {
138
+
139
+ # First attempt to serve request as file, then
140
+
141
+ # as directory, then fall back to displaying a 404.
142
+
143
+ try_files $uri $uri/ =404;
144
+
145
+ fancyindex on; # Enable FuncyIndex
146
+
147
+ fancyindex_exact_size off; # off: Use GB / MB / KB etc.
148
+
149
+ fancyindex_localtime on; # on: Use server local time
150
+
151
+ fancyindex_header /etc/nginx/header.html; # Customization Header Code
152
+
153
+ fancyindex_footer /etc/nginx/footer.html; # Customization Footer Code
154
+
155
+ }
156
+
157
+
158
+
159
+ # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
160
+
161
+ #
162
+
163
+ #location ~ .php$ {
164
+
165
+ # include snippets/fastcgi-php.conf;
166
+
167
+ #
168
+
169
+ # # With php7.0-cgi alone:
170
+
171
+ # fastcgi_pass 127.0.0.1:9000;
172
+
173
+ # # With php7.0-fpm:
174
+
175
+ # fastcgi_pass unix:/run/php/php7.0-fpm.sock;
176
+
177
+ #}
178
+
179
+
180
+
181
+ # deny access to .htaccess files, if Apache's document root
182
+
183
+ # concurs with nginx's one
184
+
185
+ #
186
+
187
+ #location ~ /.ht {
188
+
189
+ # deny all;
190
+
191
+ #}
192
+
193
+ }
194
+
195
+
196
+
197
+
198
+
199
+ # Virtual Host configuration for example.com
200
+
201
+ #
202
+
203
+ # You can move that to a different file under sites-available/ and symlink that
204
+
205
+ # to sites-enabled/ to enable it.
206
+
207
+ #
208
+
209
+ #server {
210
+
211
+ # listen 80;
212
+
213
+ # listen [::]:80;
214
+
215
+ #
216
+
217
+ # server_name example.com;
218
+
219
+ #
220
+
221
+ # root /var/www/example.com;
222
+
223
+ # index index.html;
224
+
225
+ #
226
+
227
+ # location / {
228
+
229
+ # try_files $uri $uri/ =404;
230
+
231
+ # }
232
+
233
+ #}
234
+
235
+
236
+
237
+ ```

4

文法の編集

2019/03/25 05:17

投稿

RuqenRuqen
RuqenRuqen

スコア10

test CHANGED
@@ -1 +1 @@
1
- nginxでDirectoryIndexみたいのをhtml上で表示したい。 このように実装したいと思っています。
1
+ nginxでDirectoryIndexみたいのをhtml上で表示したい。
test CHANGED
File without changes

3

文法の編集

2019/03/24 11:57

投稿

RuqenRuqen
RuqenRuqen

スコア10

test CHANGED
@@ -1 +1 @@
1
- nginxでルートディレクトリをhtml上で表示したい。
1
+ nginxでDirectoryIndexみたいのをhtml上で表示したい。 このように実装したいと思っています。
test CHANGED
File without changes

2

説明が不十分だったため

2019/03/24 11:56

投稿

RuqenRuqen
RuqenRuqen

スコア10

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- nginxでDirectoryIndexをhtml上で表示したい。
5
+ nginxでDirectoryIndexみたいのをhtml上で表示したい。
6
6
 
7
7
  このように実装したいと思っています。
8
8
 

1

説明が不十分だったため

2019/03/24 11:40

投稿

RuqenRuqen
RuqenRuqen

スコア10

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,35 @@
2
2
 
3
3
 
4
4
 
5
- nginxでルートディレクトリをhtml上で表示したい。
5
+ nginxでDirectoryIndexをhtml上で表示したい。
6
+
7
+ このように実装したいと思っています。
8
+
9
+ ```html
10
+
11
+
12
+
13
+ <html>
14
+
15
+ <head>
16
+
17
+ <title>TESTPAGE</title>
18
+
19
+ </head>
20
+
21
+
22
+
23
+ <br>TEST<br/>
24
+
25
+ [index.htmlがあるフォルダーのディレクトリを表示(選択してそのファイルを直リンクで開く)]
26
+
27
+
28
+
29
+ </body>
30
+
31
+ </html>
32
+
33
+ ```
6
34
 
7
35
 
8
36
 
@@ -10,4 +38,4 @@
10
38
 
11
39
 
12
40
 
13
- お手数ですが、よろしくお願いします。
41
+ 初心者でお手数ですが、よろしくお願いします。