当我尝试创建自定义server_name时,它只停留在默认的Nginx页面上

时间:2019-06-30 14:31:29

标签: nginx homebrew nginx-config

我刚刚收到了一台新的MacBook Pro,但是我很难让Nginx与Homebrew一起使用。我来自Linux Ubuntu环境,Nginx配置文件似乎与Homebrew位于不同的位置。

所以我的本地主机运行良好,并显示了默认的Nginx欢迎页面,但是当我尝试使用自定义public class PrendrePhoto extends AppCompatActivity { private ImageView imageView; private EditText titrImg2; private Button take; private String pathPic; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_prendre_photo); imageView = (ImageView) findViewById(R.id.imageTaken); titrImg2 = findViewById(R.id.titreImg2); take = findViewById(R.id.take); take.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { takePicture(); } }); } private void takePicture() { Intent takepic = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takepic.resolveActivity(getPackageManager()) != null) { File pic = null; pic = creerPhotoFile(); if (pic != null) { pathPic = pic.getPath(); System.out.println("pic créer"); System.out.println(pathPic); startActivityForResult(takepic, 1); }else { System.out.println("pic null"); } } } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (requestCode == 1) { Bitmap photo = BitmapFactory.decodeFile(pathPic); imageView.setImageBitmap(photo); } } //Hna je dois crée filePhoto } private File creerPhotoFile() { ZonedDateTime now = ZonedDateTime.now(); String d = ("" + now.getDayOfMonth() + "/" + now.getMonthValue() + "/" + now.getYear()); String heure = "" + now.getHour() + " : " + now.getMinute(); String titre = titrImg2.getText().toString(); File temp = new File("temp"); temp.mkdirs(); System.out.println(temp.getPath()); File image = null; /* try { image = File.createTempFile(titre, ".jpg",temp);//Even with this it didn't work } catch (IOException e) { e.printStackTrace(); }*/ image = new File(titre + ".jpg"); return image; } } 目录(例如 @Entity public class Photo implements Serializable { @PrimaryKey(autoGenerate = true) private int idP; private String titre; private String path ;//this path to get to help to display this picture private String dateHeure ; public Photo(String titre, String dateHeure) { this.titre = titre; this.dateHeure = dateHeure; } } )创建自定义服务器名(例如street.local)时,在默认的Nginx页面上。用root保存文件后,我正在重新加载Nginx。

我的简短问题:

  • 如何通过Homebrew正确设置Nginx?

我已经读过this file,但这并没有真正的帮助,因为如果我按照那里的说法~/Projects/Private/stroet/public会说符号链接不正确。

谢谢你们提前帮助我!

0 个答案:

没有答案