Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-17, 01:42:28

Author Topic: [warn] conflicting server name, help  (Read 3911 times)

0 Members and 1 Guest are viewing this topic.

Offline flameblue59

  • Senior Member
  • *
  • Posts: 177
  • Karma: +0/-0
    • View Profile
[warn] conflicting server name, help
« on: 2017-03-17, 09:15:31 »
Selamat sore, saya mengalami kendala saat ingin melakukan rewrite pada nginx.conf. Berikut ini code yang saya masukan

Code: [Select]
server {
listen 80;
server_name 1ori.com;
location / {
    try_files $uri $uri.html $uri/ @extensionless-php;
    index index.html index.htm index.php;
}

location ~ \.php$ {
    try_files $uri =404;
}

location @extensionless-php {
    rewrite ^(.*)$ $1.php last;
}
}

saat coba restart nginx untuk apply nginx.conf malah dapet error conflicting server name.


Code: [Select]
Stopping nginx:                                            [  OK  ]
Starting nginx: nginx: [warn] conflicting server name "1ori.com" on 0.0.0.0:80, ignored
                                                           [  OK  ]

Mohon bantuannya pak MR. Thank you

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [warn] conflicting server name, help
« Reply #1 on: 2017-03-17, 09:36:45 »
Itu karena domain tersebut sudah di-declare pada directory /opt/nginx/conf/domains (terkait 'server_name 1ori.com;')
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline flameblue59

  • Senior Member
  • *
  • Posts: 177
  • Karma: +0/-0
    • View Profile
Re: [warn] conflicting server name, help
« Reply #2 on: 2017-03-17, 10:37:44 »
saya coba cari opt/nginx tidak ada pak MR. Bagaimana cara aksesnya ya?

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [warn] conflicting server name, help
« Reply #3 on: 2017-03-17, 15:26:25 »
Maaf, seharusnya di /opt/configs/nginx/conf/domains.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline flameblue59

  • Senior Member
  • *
  • Posts: 177
  • Karma: +0/-0
    • View Profile
Re: [warn] conflicting server name, help
« Reply #4 on: 2017-03-17, 16:08:23 »
saya sudah coba set script ini

Code: [Select]
location / {
    try_files $uri $uri.html $uri/ @extensionless-php;
    index index.html index.htm index.php;
}

location ~ \.php$ {
    try_files $uri =404;
}

location @extensionless-php {
    rewrite ^(.*)$ $1.php last;
}

sayangnya masih tetep ga bisa pak MR, padahal saya sudah taruh pada lokasi yang benar. Berikut ini errornya

Code: [Select]
[root@server domains]# service nginx restart
nginx: [emerg] duplicate location "/" in /opt/configs/nginx/conf/globals/switch_standard.conf:57
nginx: configuration file /etc/nginx/nginx.conf test failed

bagaimana solusinya ya? Karena duplicate location "/". Padahal saya mau remove php extension yang ada di file2 saya. Thank you

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [warn] conflicting server name, help
« Reply #5 on: 2017-03-17, 17:22:26 »
Sebenarnya yang anda maui/inginkan apa?.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline flameblue59

  • Senior Member
  • *
  • Posts: 177
  • Karma: +0/-0
    • View Profile
Re: [warn] conflicting server name, help
« Reply #6 on: 2017-03-17, 17:27:12 »
saya mau menghilangkan .php extension pak MR. Jadi misalnya

domain.com/files.php

bisa diakses dengan

domain.com/files

kurang lebih sama seperti .htaccess, sayangnya htaccess tidak bisa jalan di nginx. Jadi terpaksa dari htaccess harus convert ke nginx.conf supaya bisa jalan.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: [warn] conflicting server name, help
« Reply #7 on: 2017-03-17, 17:58:30 »
1. Jalankan 'sh /script/fixweb'
2. Copy file '/opt/configs/nginx/conf/domains/domainanda.com.conf' ke '/opt/configs/nginx/conf/customs/domainanda.com.conf'
3. Ubah isi '/opt/configs/nginx/conf/customs/domainanda.com.conf' dari 'switch_standard.conf' dan 'switch_standard_ssl.conf' ke 'custom.switch_standard.conf' dan 'custom.switch_standard_ssl.conf'
4. Copy  'switch_standard.conf' dan 'switch_standard_ssl.conf' ke 'custom.switch_standard.conf' ke 'custom.switch_standard.conf' dan 'custom.switch_standard_ssl.conf' pada '/opt/configs/nginx/conf/globals'
5. Jalankan 'sh /script/restart-web'
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.066 seconds with 19 queries.

web stats analysis